mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2024-12-13 01:56:20 +01:00
e33ea0aff4
- Add a new CefBrowser::IsSame method (issue #830). - Improve CefRenderProcessHandler::OnBrowserCreated documentation (issue #830). - Add a new NavigationTest.CrossOrigin test for cross-origin navigation (issue #830). - Fix existing NavigationTest tests to run in single-process mode. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@963 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
103 lines
3.9 KiB
C++
103 lines
3.9 KiB
C++
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef CEF_LIBCEF_BROWSER_CONTENT_BROWSER_CLIENT_H_
|
|
#define CEF_LIBCEF_BROWSER_CONTENT_BROWSER_CLIENT_H_
|
|
#pragma once
|
|
|
|
#include <list>
|
|
#include <map>
|
|
#include <string>
|
|
#include <utility>
|
|
|
|
#include "base/compiler_specific.h"
|
|
#include "base/memory/ref_counted.h"
|
|
#include "base/memory/scoped_ptr.h"
|
|
#include "base/synchronization/lock.h"
|
|
#include "content/public/browser/content_browser_client.h"
|
|
|
|
class CefBrowserInfo;
|
|
class CefBrowserMainParts;
|
|
class CefMediaObserver;
|
|
class CefResourceDispatcherHostDelegate;
|
|
|
|
namespace content {
|
|
class PluginServiceFilter;
|
|
class SiteInstance;
|
|
}
|
|
|
|
class CefContentBrowserClient : public content::ContentBrowserClient {
|
|
public:
|
|
CefContentBrowserClient();
|
|
virtual ~CefContentBrowserClient();
|
|
|
|
// Returns the singleton CefContentBrowserClient instance.
|
|
static CefContentBrowserClient* Get();
|
|
|
|
CefBrowserMainParts* browser_main_parts() const {
|
|
return browser_main_parts_;
|
|
}
|
|
|
|
// Methods for managing CefBrowserInfo life span. Do not add new callers of
|
|
// these methods.
|
|
// During popup window creation there is a race between the call to
|
|
// CefBrowserMessageFilter::OnGetNewBrowserInfo on the IO thread and the call
|
|
// to CefBrowserHostImpl::WebContentsCreated on the UI thread. To resolve this
|
|
// race CefBrowserInfo may be created when requested for the first time and
|
|
// before the associated CefBrowserHostImpl is created.
|
|
scoped_refptr<CefBrowserInfo> CreateBrowserInfo();
|
|
scoped_refptr<CefBrowserInfo> GetOrCreateBrowserInfo(int render_process_id,
|
|
int render_view_id);
|
|
void RemoveBrowserInfo(scoped_refptr<CefBrowserInfo> browser_info);
|
|
void DestroyAllBrowsers();
|
|
|
|
// Retrieves the CefBrowserInfo matching the specified IDs or an empty
|
|
// pointer if no match is found. It is allowed to add new callers of this
|
|
// method but consider using CefContext::GetBrowserByRoutingID() instead.
|
|
scoped_refptr<CefBrowserInfo> GetBrowserInfo(int render_process_id,
|
|
int render_view_id);
|
|
|
|
virtual content::BrowserMainParts* CreateBrowserMainParts(
|
|
const content::MainFunctionParams& parameters) OVERRIDE;
|
|
virtual void RenderProcessHostCreated(
|
|
content::RenderProcessHost* host) OVERRIDE;
|
|
virtual content::WebContentsView* OverrideCreateWebContentsView(
|
|
content::WebContents* web_contents,
|
|
content::RenderViewHostDelegateView** rvhdv) OVERRIDE;
|
|
virtual void AppendExtraCommandLineSwitches(CommandLine* command_line,
|
|
int child_process_id) OVERRIDE;
|
|
virtual content::QuotaPermissionContext*
|
|
CreateQuotaPermissionContext() OVERRIDE;
|
|
virtual content::MediaObserver* GetMediaObserver() OVERRIDE;
|
|
virtual content::AccessTokenStore* CreateAccessTokenStore() OVERRIDE;
|
|
virtual void ResourceDispatcherHostCreated() OVERRIDE;
|
|
virtual void OverrideWebkitPrefs(content::RenderViewHost* rvh,
|
|
const GURL& url,
|
|
webkit_glue::WebPreferences* prefs) OVERRIDE;
|
|
virtual void BrowserURLHandlerCreated(
|
|
content::BrowserURLHandler* handler) OVERRIDE;
|
|
virtual std::string GetDefaultDownloadName() OVERRIDE;
|
|
|
|
#if defined(OS_WIN)
|
|
const wchar_t* GetResourceDllName() OVERRIDE;
|
|
#endif
|
|
|
|
private:
|
|
CefBrowserMainParts* browser_main_parts_;
|
|
|
|
scoped_ptr<CefMediaObserver> media_observer_;
|
|
scoped_ptr<content::PluginServiceFilter> plugin_service_filter_;
|
|
scoped_ptr<CefResourceDispatcherHostDelegate>
|
|
resource_dispatcher_host_delegate_;
|
|
|
|
base::Lock browser_info_lock_;
|
|
|
|
// Access must be protected by |browser_info_lock_|.
|
|
typedef std::list<scoped_refptr<CefBrowserInfo> > BrowserInfoList;
|
|
BrowserInfoList browser_info_list_;
|
|
int next_browser_id_;
|
|
};
|
|
|
|
#endif // CEF_LIBCEF_BROWSER_CONTENT_BROWSER_CLIENT_H_
|