Rename CefBrowserHostImpl to AlloyBrowserHostImpl (see issue #2969)

After commit 38d8acfa18 this object is only used with the alloy runtime.
This commit is contained in:
Marshall Greenblatt
2020-09-22 15:54:02 -04:00
parent 9022d40e6a
commit e94a261bf5
100 changed files with 691 additions and 713 deletions

View File

@ -409,6 +409,8 @@ static_library("libcef_static") {
gypi_paths.autogen_cpp_includes + [ gypi_paths.autogen_cpp_includes + [
"libcef/browser/alloy/alloy_browser_context.cc", "libcef/browser/alloy/alloy_browser_context.cc",
"libcef/browser/alloy/alloy_browser_context.h", "libcef/browser/alloy/alloy_browser_context.h",
"libcef/browser/alloy/alloy_browser_host_impl.cc",
"libcef/browser/alloy/alloy_browser_host_impl.h",
"libcef/browser/alloy/alloy_browser_main.cc", "libcef/browser/alloy/alloy_browser_main.cc",
"libcef/browser/alloy/alloy_browser_main.h", "libcef/browser/alloy/alloy_browser_main.h",
"libcef/browser/alloy/browser_platform_delegate_alloy.cc", "libcef/browser/alloy/browser_platform_delegate_alloy.cc",
@ -432,8 +434,6 @@ static_library("libcef_static") {
"libcef/browser/browser_host_base.cc", "libcef/browser/browser_host_base.cc",
"libcef/browser/browser_host_base.h", "libcef/browser/browser_host_base.h",
"libcef/browser/browser_host_create.cc", "libcef/browser/browser_host_create.cc",
"libcef/browser/browser_host_impl.cc",
"libcef/browser/browser_host_impl.h",
"libcef/browser/browser_info.cc", "libcef/browser/browser_info.cc",
"libcef/browser/browser_info.h", "libcef/browser/browser_info.h",
"libcef/browser/browser_info_manager.cc", "libcef/browser/browser_info_manager.cc",

View File

@ -115,8 +115,8 @@ class AlloyBrowserContext : public ChromeProfileAlloy,
return extension_system_; return extension_system_;
} }
// Called from CefBrowserHostImpl::DidFinishNavigation to update the table of // Called from AlloyBrowserHostImpl::DidFinishNavigation to update the table
// visited links. // of visited links.
void AddVisitedURLs(const std::vector<GURL>& urls); void AddVisitedURLs(const std::vector<GURL>& urls);
// Called from DownloadPrefs::FromBrowserContext. // Called from DownloadPrefs::FromBrowserContext.

View File

@ -3,8 +3,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CEF_LIBCEF_BROWSER_BROWSER_HOST_IMPL_H_ #ifndef CEF_LIBCEF_BROWSER_ALLOY_ALLOY_BROWSER_HOST_IMPL_H_
#define CEF_LIBCEF_BROWSER_BROWSER_HOST_IMPL_H_ #define CEF_LIBCEF_BROWSER_ALLOY_ALLOY_BROWSER_HOST_IMPL_H_
#pragma once #pragma once
#include <map> #include <map>
@ -62,22 +62,22 @@ class SiteInstance;
// thread-safe unless otherwise indicated. // thread-safe unless otherwise indicated.
// //
// WebContentsDelegate: Interface for handling WebContents delegations. There is // WebContentsDelegate: Interface for handling WebContents delegations. There is
// a one-to-one relationship between CefBrowserHostImpl and WebContents // a one-to-one relationship between AlloyBrowserHostImpl and WebContents
// instances. // instances.
// //
// WebContentsObserver: Interface for observing WebContents notifications and // WebContentsObserver: Interface for observing WebContents notifications and
// IPC messages. There is a one-to-one relationship between WebContents and // IPC messages. There is a one-to-one relationship between WebContents and
// RenderViewHost instances. IPC messages received by the RenderViewHost will be // RenderViewHost instances. IPC messages received by the RenderViewHost will be
// forwarded to this WebContentsObserver implementation via WebContents. IPC // forwarded to this WebContentsObserver implementation via WebContents. IPC
// messages sent using CefBrowserHostImpl::Send() will be forwarded to the // messages sent using AlloyBrowserHostImpl::Send() will be forwarded to the
// RenderViewHost (after posting to the UI thread if necessary). Use // RenderViewHost (after posting to the UI thread if necessary). Use
// WebContentsObserver::routing_id() when sending IPC messages. // WebContentsObserver::routing_id() when sending IPC messages.
// //
// NotificationObserver: Interface for observing post-processed notifications. // NotificationObserver: Interface for observing post-processed notifications.
class CefBrowserHostImpl : public CefBrowserHostBase, class AlloyBrowserHostImpl : public CefBrowserHostBase,
public content::WebContentsDelegate, public content::WebContentsDelegate,
public content::WebContentsObserver, public content::WebContentsObserver,
public content::NotificationObserver { public content::NotificationObserver {
public: public:
// Used for handling the response to command messages. // Used for handling the response to command messages.
class CommandResponseHandler : public virtual CefBaseRefCounted { class CommandResponseHandler : public virtual CefBaseRefCounted {
@ -85,25 +85,25 @@ class CefBrowserHostImpl : public CefBrowserHostBase,
virtual void OnResponse(const std::string& response) = 0; virtual void OnResponse(const std::string& response) = 0;
}; };
~CefBrowserHostImpl() override; ~AlloyBrowserHostImpl() override;
// Create a new CefBrowserHostImpl instance with owned WebContents. // Create a new AlloyBrowserHostImpl instance with owned WebContents.
static CefRefPtr<CefBrowserHostImpl> Create(CreateParams& create_params); static CefRefPtr<AlloyBrowserHostImpl> Create(CreateParams& create_params);
// Returns the browser associated with the specified RenderViewHost. // Returns the browser associated with the specified RenderViewHost.
static CefRefPtr<CefBrowserHostImpl> GetBrowserForHost( static CefRefPtr<AlloyBrowserHostImpl> GetBrowserForHost(
const content::RenderViewHost* host); const content::RenderViewHost* host);
// Returns the browser associated with the specified RenderFrameHost. // Returns the browser associated with the specified RenderFrameHost.
static CefRefPtr<CefBrowserHostImpl> GetBrowserForHost( static CefRefPtr<AlloyBrowserHostImpl> GetBrowserForHost(
const content::RenderFrameHost* host); const content::RenderFrameHost* host);
// Returns the browser associated with the specified WebContents. // Returns the browser associated with the specified WebContents.
static CefRefPtr<CefBrowserHostImpl> GetBrowserForContents( static CefRefPtr<AlloyBrowserHostImpl> GetBrowserForContents(
const content::WebContents* contents); const content::WebContents* contents);
// Returns the browser associated with the specified FrameTreeNode ID. // Returns the browser associated with the specified FrameTreeNode ID.
static CefRefPtr<CefBrowserHostImpl> GetBrowserForFrameTreeNode( static CefRefPtr<AlloyBrowserHostImpl> GetBrowserForFrameTreeNode(
int frame_tree_node_id); int frame_tree_node_id);
// Returns the browser associated with the specified frame routing IDs. // Returns the browser associated with the specified frame routing IDs.
static CefRefPtr<CefBrowserHostImpl> GetBrowserForFrameRoute( static CefRefPtr<AlloyBrowserHostImpl> GetBrowserForFrameRoute(
int render_process_id, int render_process_id,
int render_routing_id); int render_routing_id);
@ -379,13 +379,13 @@ class CefBrowserHostImpl : public CefBrowserHostBase,
private: private:
friend class CefBrowserPlatformDelegateAlloy; friend class CefBrowserPlatformDelegateAlloy;
static CefRefPtr<CefBrowserHostImpl> CreateInternal( static CefRefPtr<AlloyBrowserHostImpl> CreateInternal(
const CefBrowserSettings& settings, const CefBrowserSettings& settings,
CefRefPtr<CefClient> client, CefRefPtr<CefClient> client,
content::WebContents* web_contents, content::WebContents* web_contents,
bool own_web_contents, bool own_web_contents,
scoped_refptr<CefBrowserInfo> browser_info, scoped_refptr<CefBrowserInfo> browser_info,
CefRefPtr<CefBrowserHostImpl> opener, CefRefPtr<AlloyBrowserHostImpl> opener,
bool is_devtools_popup, bool is_devtools_popup,
CefRefPtr<CefRequestContextImpl> request_context, CefRefPtr<CefRequestContextImpl> request_context,
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate, std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate,
@ -396,12 +396,12 @@ class CefBrowserHostImpl : public CefBrowserHostBase,
const content::NotificationSource& source, const content::NotificationSource& source,
const content::NotificationDetails& details) override; const content::NotificationDetails& details) override;
CefBrowserHostImpl( AlloyBrowserHostImpl(
const CefBrowserSettings& settings, const CefBrowserSettings& settings,
CefRefPtr<CefClient> client, CefRefPtr<CefClient> client,
content::WebContents* web_contents, content::WebContents* web_contents,
scoped_refptr<CefBrowserInfo> browser_info, scoped_refptr<CefBrowserInfo> browser_info,
CefRefPtr<CefBrowserHostImpl> opener, CefRefPtr<AlloyBrowserHostImpl> opener,
CefRefPtr<CefRequestContextImpl> request_context, CefRefPtr<CefRequestContextImpl> request_context,
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate, std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate,
CefRefPtr<CefExtension> extension); CefRefPtr<CefExtension> extension);
@ -470,4 +470,4 @@ class CefBrowserHostImpl : public CefBrowserHostBase,
base::OneShotTimer recently_audible_timer_; base::OneShotTimer recently_audible_timer_;
}; };
#endif // CEF_LIBCEF_BROWSER_BROWSER_HOST_IMPL_H_ #endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_BROWSER_HOST_IMPL_H_

View File

@ -9,9 +9,9 @@
#include "include/cef_version.h" #include "include/cef_version.h"
#include "libcef/browser/alloy/alloy_browser_context.h" #include "libcef/browser/alloy/alloy_browser_context.h"
#include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/alloy/alloy_browser_main.h" #include "libcef/browser/alloy/alloy_browser_main.h"
#include "libcef/browser/browser_context.h" #include "libcef/browser/browser_context.h"
#include "libcef/browser/browser_host_impl.h"
#include "libcef/browser/browser_info.h" #include "libcef/browser/browser_info.h"
#include "libcef/browser/browser_info_manager.h" #include "libcef/browser/browser_info_manager.h"
#include "libcef/browser/browser_message_filter.h" #include "libcef/browser/browser_message_filter.h"
@ -349,9 +349,9 @@ class CefQuotaPermissionContext : public content::QuotaPermissionContext {
bool handled = false; bool handled = false;
CefRefPtr<CefBrowserHostImpl> browser = CefRefPtr<AlloyBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserForFrameRoute(render_process_id, AlloyBrowserHostImpl::GetBrowserForFrameRoute(render_process_id,
params.render_frame_id); params.render_frame_id);
if (browser.get()) { if (browser.get()) {
CefRefPtr<CefClient> client = browser->GetClient(); CefRefPtr<CefClient> client = browser->GetClient();
if (client.get()) { if (client.get()) {
@ -459,7 +459,7 @@ bool NavigationOnUIThread(
open_params.user_gesture = params.has_user_gesture(); open_params.user_gesture = params.has_user_gesture();
open_params.initiator_origin = params.initiator_origin(); open_params.initiator_origin = params.initiator_origin();
CefRefPtr<CefBrowserHostImpl> browser; CefRefPtr<AlloyBrowserHostImpl> browser;
if (!CefBrowserInfoManager::GetInstance()->MaybeAllowNavigation( if (!CefBrowserInfoManager::GetInstance()->MaybeAllowNavigation(
source->GetMainFrame(), open_params, browser)) { source->GetMainFrame(), open_params, browser)) {
// Cancel the navigation. // Cancel the navigation.
@ -939,8 +939,8 @@ void AlloyContentBrowserClient::AllowCertificateError(
return; return;
} }
CefRefPtr<CefBrowserHostImpl> browser = CefRefPtr<AlloyBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserForContents(web_contents); AlloyBrowserHostImpl::GetBrowserForContents(web_contents);
if (!browser.get()) if (!browser.get())
return; return;
CefRefPtr<CefClient> client = browser->GetClient(); CefRefPtr<CefClient> client = browser->GetClient();
@ -975,8 +975,8 @@ base::OnceClosure AlloyContentBrowserClient::SelectClientCertificate(
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
CefRefPtr<CefRequestHandler> handler; CefRefPtr<CefRequestHandler> handler;
CefRefPtr<CefBrowserHostImpl> browser = CefRefPtr<AlloyBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserForContents(web_contents); AlloyBrowserHostImpl::GetBrowserForContents(web_contents);
if (browser.get()) { if (browser.get()) {
CefRefPtr<CefClient> client = browser->GetClient(); CefRefPtr<CefClient> client = browser->GetClient();
if (client.get()) if (client.get())

View File

@ -4,7 +4,7 @@
#include "libcef/browser/alloy/browser_platform_delegate_alloy.h" #include "libcef/browser/alloy/browser_platform_delegate_alloy.h"
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/extensions/browser_extensions_util.h" #include "libcef/browser/extensions/browser_extensions_util.h"
#include "libcef/browser/extensions/extension_background_host.h" #include "libcef/browser/extensions/extension_background_host.h"
#include "libcef/browser/extensions/extension_system.h" #include "libcef/browser/extensions/extension_system.h"
@ -105,8 +105,8 @@ void CefBrowserPlatformDelegateAlloy::AddNewContents(
const gfx::Rect& initial_rect, const gfx::Rect& initial_rect,
bool user_gesture, bool user_gesture,
bool* was_blocked) { bool* was_blocked) {
CefRefPtr<CefBrowserHostImpl> owner = CefRefPtr<AlloyBrowserHostImpl> owner =
CefBrowserHostImpl::GetBrowserForContents(new_contents.get()); AlloyBrowserHostImpl::GetBrowserForContents(new_contents.get());
if (owner) { if (owner) {
// Taking ownership of |new_contents|. // Taking ownership of |new_contents|.
static_cast<CefBrowserPlatformDelegateAlloy*>( static_cast<CefBrowserPlatformDelegateAlloy*>(
@ -143,7 +143,7 @@ void CefBrowserPlatformDelegateAlloy::RenderViewReady() {
} }
void CefBrowserPlatformDelegateAlloy::BrowserCreated( void CefBrowserPlatformDelegateAlloy::BrowserCreated(
CefBrowserHostImpl* browser) { AlloyBrowserHostImpl* browser) {
CefBrowserPlatformDelegate::BrowserCreated(browser); CefBrowserPlatformDelegate::BrowserCreated(browser);
web_contents_->SetDelegate(browser); web_contents_->SetDelegate(browser);
@ -202,7 +202,7 @@ extensions::ExtensionHost* CefBrowserPlatformDelegateAlloy::GetExtensionHost()
} }
void CefBrowserPlatformDelegateAlloy::BrowserDestroyed( void CefBrowserPlatformDelegateAlloy::BrowserDestroyed(
CefBrowserHostImpl* browser) { AlloyBrowserHostImpl* browser) {
DestroyExtensionHost(); DestroyExtensionHost();
owned_web_contents_.reset(); owned_web_contents_.reset();

View File

@ -29,12 +29,12 @@ class CefBrowserPlatformDelegateAlloy : public CefBrowserPlatformDelegate {
bool ShouldTransferNavigation(bool is_main_frame_navigation) override; bool ShouldTransferNavigation(bool is_main_frame_navigation) override;
void RenderViewCreated(content::RenderViewHost* render_view_host) override; void RenderViewCreated(content::RenderViewHost* render_view_host) override;
void RenderViewReady() override; void RenderViewReady() override;
void BrowserCreated(CefBrowserHostImpl* browser) override; void BrowserCreated(AlloyBrowserHostImpl* browser) override;
void CreateExtensionHost(const extensions::Extension* extension, void CreateExtensionHost(const extensions::Extension* extension,
const GURL& url, const GURL& url,
extensions::ViewType host_type) override; extensions::ViewType host_type) override;
extensions::ExtensionHost* GetExtensionHost() const override; extensions::ExtensionHost* GetExtensionHost() const override;
void BrowserDestroyed(CefBrowserHostImpl* browser) override; void BrowserDestroyed(AlloyBrowserHostImpl* browser) override;
void SendCaptureLostEvent() override; void SendCaptureLostEvent() override;
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MAC)) #if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MAC))
void NotifyMoveOrResizeStarted() override; void NotifyMoveOrResizeStarted() override;

View File

@ -4,7 +4,7 @@
// found in the LICENSE file. // found in the LICENSE file.
#include "libcef/browser/audio_capturer.h" #include "libcef/browser/audio_capturer.h"
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "components/mirroring/service/captured_audio_input.h" #include "components/mirroring/service/captured_audio_input.h"
#include "content/public/browser/audio_loopback_stream_creator.h" #include "content/public/browser/audio_loopback_stream_creator.h"
@ -51,7 +51,7 @@ void StreamCreatorHelper(
} // namespace } // namespace
CefAudioCapturer::CefAudioCapturer(const CefAudioParameters& params, CefAudioCapturer::CefAudioCapturer(const CefAudioParameters& params,
CefRefPtr<CefBrowserHostImpl> browser, CefRefPtr<AlloyBrowserHostImpl> browser,
CefRefPtr<CefAudioHandler> audio_handler) CefRefPtr<CefAudioHandler> audio_handler)
: params_(params), : params_(params),
browser_(browser), browser_(browser),

View File

@ -21,12 +21,12 @@ class AudioInputDevice;
} // namespace media } // namespace media
class CefAudioHandler; class CefAudioHandler;
class CefBrowserHostImpl; class AlloyBrowserHostImpl;
class CefAudioCapturer : public media::AudioCapturerSource::CaptureCallback { class CefAudioCapturer : public media::AudioCapturerSource::CaptureCallback {
public: public:
CefAudioCapturer(const CefAudioParameters& params, CefAudioCapturer(const CefAudioParameters& params,
CefRefPtr<CefBrowserHostImpl> browser, CefRefPtr<AlloyBrowserHostImpl> browser,
CefRefPtr<CefAudioHandler> audio_handler); CefRefPtr<CefAudioHandler> audio_handler);
~CefAudioCapturer() override; ~CefAudioCapturer() override;
@ -42,7 +42,7 @@ class CefAudioCapturer : public media::AudioCapturerSource::CaptureCallback {
void StopStream(); void StopStream();
CefAudioParameters params_; CefAudioParameters params_;
CefRefPtr<CefBrowserHostImpl> browser_; CefRefPtr<AlloyBrowserHostImpl> browser_;
CefRefPtr<CefAudioHandler> audio_handler_; CefRefPtr<CefAudioHandler> audio_handler_;
std::unique_ptr<content::AudioLoopbackStreamCreator> audio_stream_creator_; std::unique_ptr<content::AudioLoopbackStreamCreator> audio_stream_creator_;
scoped_refptr<media::AudioInputDevice> audio_input_device_; scoped_refptr<media::AudioInputDevice> audio_input_device_;

View File

@ -27,7 +27,7 @@
// Content API representation of a browser. Created by BHI or the system (for // Content API representation of a browser. Created by BHI or the system (for
// popups) and owned by BHI. Keeps a pointer to the content::BrowserContext. // popups) and owned by BHI. Keeps a pointer to the content::BrowserContext.
// //
// BHI = CefBrowserHostImpl // BHI = AlloyBrowserHostImpl
// Implements the CefBrowser and CefBrowserHost interfaces which are exposed // Implements the CefBrowser and CefBrowserHost interfaces which are exposed
// to clients. References an RCI instance. Owns a WC. Lifespan is controlled // to clients. References an RCI instance. Owns a WC. Lifespan is controlled
// by client references and CefBrowserInfoManager (until the browser has // by client references and CefBrowserInfoManager (until the browser has
@ -62,9 +62,9 @@
// //
// //
// How shutdown works: // How shutdown works:
// 1. CefBrowserHostImpl::DestroyBrowser is called on the UI thread after the // 1. AlloyBrowserHostImpl::DestroyBrowser is called on the UI thread after the
// browser is closed and deletes the WebContents. // browser is closed and deletes the WebContents.
// 1. CefBrowserHostImpl is destroyed on any thread when the last reference // 1. AlloyBrowserHostImpl is destroyed on any thread when the last reference
// is released. // is released.
// 2. CefRequestContextImpl is destroyed (possibly asynchronously) on the UI // 2. CefRequestContextImpl is destroyed (possibly asynchronously) on the UI
// thread when the last reference is released. // thread when the last reference is released.
@ -85,7 +85,7 @@ class Profile;
// Main entry point for configuring behavior on a per-RequestContext basis. The // Main entry point for configuring behavior on a per-RequestContext basis. The
// content::BrowserContext represented by this class is passed to // content::BrowserContext represented by this class is passed to
// WebContents::Create in CefBrowserHostImpl::CreateInternal. Only accessed on // WebContents::Create in AlloyBrowserHostImpl::CreateInternal. Only accessed on
// the UI thread unless otherwise indicated. // the UI thread unless otherwise indicated.
class CefBrowserContext { class CefBrowserContext {
public: public:

View File

@ -558,9 +558,7 @@ void CefBrowserHostBase::LoadMainFrameURL(const std::string& url,
} }
if (!gurl.is_valid()) { if (!gurl.is_valid()) {
LOG(ERROR) LOG(ERROR) << "Invalid URL: " << url;
<< "Invalid URL passed to CefBrowserHostImpl::LoadMainFrameURL: "
<< url;
return; return;
} }

View File

@ -4,7 +4,7 @@
// found in the LICENSE file. // found in the LICENSE file.
#include "include/cef_browser.h" #include "include/cef_browser.h"
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/chrome/chrome_browser_host_impl.h" #include "libcef/browser/chrome/chrome_browser_host_impl.h"
#include "libcef/browser/context.h" #include "libcef/browser/context.h"
#include "libcef/browser/thread_util.h" #include "libcef/browser/thread_util.h"
@ -139,6 +139,6 @@ CefRefPtr<CefBrowser> CefBrowserHost::CreateBrowserSync(
return browser.get(); return browser.get();
} }
auto browser = CefBrowserHostImpl::Create(create_params); auto browser = AlloyBrowserHostImpl::Create(create_params);
return browser.get(); return browser.get();
} }

View File

@ -4,7 +4,7 @@
#include "libcef/browser/browser_info.h" #include "libcef/browser/browser_info.h"
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/browser_host_base.h"
#include "libcef/browser/thread_util.h" #include "libcef/browser/thread_util.h"
#include "libcef/common/values_impl.h" #include "libcef/common/values_impl.h"

View File

@ -6,7 +6,7 @@
#include <utility> #include <utility>
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/browser_platform_delegate.h" #include "libcef/browser/browser_platform_delegate.h"
#include "libcef/browser/extensions/browser_extensions_util.h" #include "libcef/browser/extensions/browser_extensions_util.h"
#include "libcef/browser/thread_util.h" #include "libcef/browser/thread_util.h"
@ -124,7 +124,7 @@ bool CefBrowserInfoManager::CanCreateWindow(
/*is_renderer_initiated=*/true); /*is_renderer_initiated=*/true);
params.user_gesture = user_gesture; params.user_gesture = user_gesture;
CefRefPtr<CefBrowserHostImpl> browser; CefRefPtr<AlloyBrowserHostImpl> browser;
if (!MaybeAllowNavigation(opener, params, browser) || !browser) { if (!MaybeAllowNavigation(opener, params, browser) || !browser) {
// Cancel the popup. // Cancel the popup.
return false; return false;
@ -365,12 +365,12 @@ CefBrowserInfoManager::GetBrowserInfoForFrameRoute(int render_process_id,
bool CefBrowserInfoManager::MaybeAllowNavigation( bool CefBrowserInfoManager::MaybeAllowNavigation(
content::RenderFrameHost* opener, content::RenderFrameHost* opener,
const content::OpenURLParams& params, const content::OpenURLParams& params,
CefRefPtr<CefBrowserHostImpl>& browser_out) const { CefRefPtr<AlloyBrowserHostImpl>& browser_out) const {
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
REQUIRE_ALLOY_RUNTIME(); REQUIRE_ALLOY_RUNTIME();
bool is_guest_view = false; bool is_guest_view = false;
CefRefPtr<CefBrowserHostImpl> browser = static_cast<CefBrowserHostImpl*>( CefRefPtr<AlloyBrowserHostImpl> browser = static_cast<AlloyBrowserHostImpl*>(
extensions::GetOwnerBrowserForHost(opener, &is_guest_view).get()); extensions::GetOwnerBrowserForHost(opener, &is_guest_view).get());
if (!browser) { if (!browser) {
// Print preview uses a modal dialog where we don't own the WebContents. // Print preview uses a modal dialog where we don't own the WebContents.
@ -385,7 +385,7 @@ bool CefBrowserInfoManager::MaybeAllowNavigation(
// are passed to the owner browser. // are passed to the owner browser.
CEF_POST_TASK( CEF_POST_TASK(
CEF_UIT, CEF_UIT,
base::Bind(base::IgnoreResult(&CefBrowserHostImpl::OpenURLFromTab), base::Bind(base::IgnoreResult(&AlloyBrowserHostImpl::OpenURLFromTab),
browser.get(), nullptr, params)); browser.get(), nullptr, params));
return false; return false;

View File

@ -38,7 +38,7 @@ class Message;
} }
class CefBrowserHostBase; class CefBrowserHostBase;
class CefBrowserHostImpl; class AlloyBrowserHostImpl;
class CefBrowserPlatformDelegate; class CefBrowserPlatformDelegate;
// Singleton object for managing BrowserInfo instances. // Singleton object for managing BrowserInfo instances.
@ -50,7 +50,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
// Returns this singleton instance of this class. // Returns this singleton instance of this class.
static CefBrowserInfoManager* GetInstance(); static CefBrowserInfoManager* GetInstance();
// Called from CefBrowserHostImpl::Create or // Called from AlloyBrowserHostImpl::Create or
// ChromeBrowserDelegate::SetAsDelegate when a new browser is being created // ChromeBrowserDelegate::SetAsDelegate when a new browser is being created
// directly. In this case |is_popup| will be true only for DevTools browsers. // directly. In this case |is_popup| will be true only for DevTools browsers.
scoped_refptr<CefBrowserInfo> CreateBrowserInfo( scoped_refptr<CefBrowserInfo> CreateBrowserInfo(
@ -58,7 +58,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
bool is_windowless, bool is_windowless,
CefRefPtr<CefDictionaryValue> extra_info); CefRefPtr<CefDictionaryValue> extra_info);
// Called from CefBrowserHostImpl::WebContentsCreated when a new browser is // Called from AlloyBrowserHostImpl::WebContentsCreated when a new browser is
// being created for a traditional popup (e.g. window.open() or targeted // being created for a traditional popup (e.g. window.open() or targeted
// link). If any OnGetNewBrowserInfo requests are pending for the popup the // link). If any OnGetNewBrowserInfo requests are pending for the popup the
// response will be sent when this method is called. // response will be sent when this method is called.
@ -79,7 +79,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
bool opener_suppressed, bool opener_suppressed,
bool* no_javascript_access); bool* no_javascript_access);
// Called from CefBrowserHostImpl::GetCustomWebContentsView. See comments on // Called from AlloyBrowserHostImpl::GetCustomWebContentsView. See comments on
// PendingPopup for more information. // PendingPopup for more information.
void GetCustomWebContentsView( void GetCustomWebContentsView(
const GURL& target_url, const GURL& target_url,
@ -88,7 +88,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
content::WebContentsView** view, content::WebContentsView** view,
content::RenderViewHostDelegateView** delegate_view); content::RenderViewHostDelegateView** delegate_view);
// Called from CefBrowserHostImpl::WebContentsCreated. See comments on // Called from AlloyBrowserHostImpl::WebContentsCreated. See comments on
// PendingPopup for more information. // PendingPopup for more information.
void WebContentsCreated( void WebContentsCreated(
const GURL& target_url, const GURL& target_url,
@ -147,7 +147,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
// |browser| will be set to the target browser if any. // |browser| will be set to the target browser if any.
bool MaybeAllowNavigation(content::RenderFrameHost* opener, bool MaybeAllowNavigation(content::RenderFrameHost* opener,
const content::OpenURLParams& params, const content::OpenURLParams& params,
CefRefPtr<CefBrowserHostImpl>& browser) const; CefRefPtr<AlloyBrowserHostImpl>& browser) const;
private: private:
// RenderProcessHostObserver methods: // RenderProcessHostObserver methods:
@ -158,12 +158,12 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
// Provides an opportunity to cancel the popup (calls OnBeforePopup) and // Provides an opportunity to cancel the popup (calls OnBeforePopup) and
// creates the new platform delegate for the popup. If the popup owner is // creates the new platform delegate for the popup. If the popup owner is
// an extension guest view then the popup is canceled and // an extension guest view then the popup is canceled and
// CefBrowserHostImpl::OpenURLFromTab is called. // AlloyBrowserHostImpl::OpenURLFromTab is called.
// And then the following calls may occur at the same time: // And then the following calls may occur at the same time:
// - CefBrowserHostImpl::GetCustomWebContentsView (UIT) // - AlloyBrowserHostImpl::GetCustomWebContentsView (UIT)
// Creates the OSR views for windowless popups. // Creates the OSR views for windowless popups.
// - CefBrowserHostImpl::WebContentsCreated (UIT) // - AlloyBrowserHostImpl::WebContentsCreated (UIT)
// Creates the CefBrowserHostImpl representation for the popup. // Creates the AlloyBrowserHostImpl representation for the popup.
// - CefBrowserMessageFilter::OnGetNewBrowserInfo (IOT) // - CefBrowserMessageFilter::OnGetNewBrowserInfo (IOT)
// Passes information about the popup to the renderer process. // Passes information about the popup to the renderer process.
struct PendingPopup { struct PendingPopup {

View File

@ -4,7 +4,7 @@
#include "libcef/browser/browser_platform_delegate.h" #include "libcef/browser/browser_platform_delegate.h"
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "base/logging.h" #include "base/logging.h"
@ -57,7 +57,7 @@ void CefBrowserPlatformDelegate::RenderViewCreated(
void CefBrowserPlatformDelegate::RenderViewReady() {} void CefBrowserPlatformDelegate::RenderViewReady() {}
void CefBrowserPlatformDelegate::BrowserCreated(CefBrowserHostImpl* browser) { void CefBrowserPlatformDelegate::BrowserCreated(AlloyBrowserHostImpl* browser) {
// We should have an associated WebContents at this point. // We should have an associated WebContents at this point.
DCHECK(web_contents_); DCHECK(web_contents_);
@ -83,7 +83,8 @@ void CefBrowserPlatformDelegate::NotifyBrowserCreated() {}
void CefBrowserPlatformDelegate::NotifyBrowserDestroyed() {} void CefBrowserPlatformDelegate::NotifyBrowserDestroyed() {}
void CefBrowserPlatformDelegate::BrowserDestroyed(CefBrowserHostImpl* browser) { void CefBrowserPlatformDelegate::BrowserDestroyed(
AlloyBrowserHostImpl* browser) {
// WebContentsDestroyed should already be called. // WebContentsDestroyed should already be called.
DCHECK(!web_contents_); DCHECK(!web_contents_);
@ -120,7 +121,7 @@ void CefBrowserPlatformDelegate::PopupWebContentsCreated(
bool is_devtools) {} bool is_devtools) {}
void CefBrowserPlatformDelegate::PopupBrowserCreated( void CefBrowserPlatformDelegate::PopupBrowserCreated(
CefBrowserHostImpl* new_browser, AlloyBrowserHostImpl* new_browser,
bool is_devtools) {} bool is_devtools) {}
void CefBrowserPlatformDelegate::SendCaptureLostEvent() { void CefBrowserPlatformDelegate::SendCaptureLostEvent() {

View File

@ -13,7 +13,7 @@
#include "include/cef_drag_data.h" #include "include/cef_drag_data.h"
#include "include/internal/cef_types.h" #include "include/internal/cef_types.h"
#include "include/views/cef_browser_view.h" #include "include/views/cef_browser_view.h"
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "base/callback_forward.h" #include "base/callback_forward.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
@ -56,7 +56,7 @@ class CefBrowserPlatformDelegate {
static std::unique_ptr<CefBrowserPlatformDelegate> Create( static std::unique_ptr<CefBrowserPlatformDelegate> Create(
CefBrowserHostBase::CreateParams& create_params); CefBrowserHostBase::CreateParams& create_params);
// Called from CefBrowserHostImpl::Create. // Called from AlloyBrowserHostImpl::Create.
// Wait for the call to WebContentsCreated(owned=true) before taking ownership // Wait for the call to WebContentsCreated(owned=true) before taking ownership
// of the resulting WebContents object. // of the resulting WebContents object.
virtual content::WebContents* CreateWebContents( virtual content::WebContents* CreateWebContents(
@ -103,12 +103,12 @@ class CefBrowserPlatformDelegate {
// See WebContentsObserver documentation. // See WebContentsObserver documentation.
virtual void RenderViewReady(); virtual void RenderViewReady();
// Called after the owning CefBrowserHostImpl is created. Will only be called // Called after the owning AlloyBrowserHostImpl is created. Will only be
// a single time per instance. Do not send any client notifications from this // called a single time per instance. Do not send any client notifications
// method. // from this method.
virtual void BrowserCreated(CefBrowserHostImpl* browser); virtual void BrowserCreated(AlloyBrowserHostImpl* browser);
// Called from CefBrowserHostImpl::Create. // Called from AlloyBrowserHostImpl::Create.
virtual void CreateExtensionHost(const extensions::Extension* extension, virtual void CreateExtensionHost(const extensions::Extension* extension,
const GURL& url, const GURL& url,
extensions::ViewType host_type); extensions::ViewType host_type);
@ -124,11 +124,11 @@ class CefBrowserPlatformDelegate {
// BrowserDestroyed(). // BrowserDestroyed().
virtual void NotifyBrowserDestroyed(); virtual void NotifyBrowserDestroyed();
// Called before the owning CefBrowserHostImpl is destroyed. Will only be // Called before the owning AlloyBrowserHostImpl is destroyed. Will only be
// called a single time per instance. All references to the CefBrowserHostImpl // called a single time per instance. All references to the
// and WebContents should be cleared when this method is called. Do not send // AlloyBrowserHostImpl and WebContents should be cleared when this method is
// any client notifications from this method. // called. Do not send any client notifications from this method.
virtual void BrowserDestroyed(CefBrowserHostImpl* browser); virtual void BrowserDestroyed(AlloyBrowserHostImpl* browser);
// Create the window that hosts the browser. Will only be called a single time // Create the window that hosts the browser. Will only be called a single time
// per instance. Only used with windowed rendering. // per instance. Only used with windowed rendering.
@ -156,7 +156,7 @@ class CefBrowserPlatformDelegate {
#endif #endif
// Called after the WebContents have been created for a new popup browser // Called after the WebContents have been created for a new popup browser
// parented to this browser but before the CefBrowserHostImpl is created for // parented to this browser but before the AlloyBrowserHostImpl is created for
// the popup. |is_devtools| will be true if the popup will host DevTools. This // the popup. |is_devtools| will be true if the popup will host DevTools. This
// method will be called before WebContentsCreated() is called on // method will be called before WebContentsCreated() is called on
// |new_platform_delegate|. Do not make the new browser visible in this // |new_platform_delegate|. Do not make the new browser visible in this
@ -168,13 +168,13 @@ class CefBrowserPlatformDelegate {
CefBrowserPlatformDelegate* new_platform_delegate, CefBrowserPlatformDelegate* new_platform_delegate,
bool is_devtools); bool is_devtools);
// Called after the CefBrowserHostImpl is created for a new popup browser // Called after the AlloyBrowserHostImpl is created for a new popup browser
// parented to this browser. |is_devtools| will be true if the popup will host // parented to this browser. |is_devtools| will be true if the popup will host
// DevTools. This method will be called immediately after // DevTools. This method will be called immediately after
// CefLifeSpanHandler::OnAfterCreated() for the popup browser. It is safe to // CefLifeSpanHandler::OnAfterCreated() for the popup browser. It is safe to
// make the new browser visible in this callback (for example, add the browser // make the new browser visible in this callback (for example, add the browser
// to a window and show it). // to a window and show it).
virtual void PopupBrowserCreated(CefBrowserHostImpl* new_browser, virtual void PopupBrowserCreated(AlloyBrowserHostImpl* new_browser,
bool is_devtools); bool is_devtools);
// Returns the background color for the browser. The alpha component will be // Returns the background color for the browser. The alpha component will be
@ -343,7 +343,7 @@ class CefBrowserPlatformDelegate {
// Not owned by this object. // Not owned by this object.
content::WebContents* web_contents_ = nullptr; content::WebContents* web_contents_ = nullptr;
CefBrowserHostImpl* browser_ = nullptr; AlloyBrowserHostImpl* browser_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(CefBrowserPlatformDelegate); DISALLOW_COPY_AND_ASSIGN(CefBrowserPlatformDelegate);
}; };

View File

@ -17,14 +17,11 @@
#include "base/threading/platform_thread.h" #include "base/threading/platform_thread.h"
#include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkColor.h"
class CefBrowserHostImpl;
class CefBrowserInfoManager; class CefBrowserInfoManager;
class CefTraceSubscriber; class CefTraceSubscriber;
class CefContext { class CefContext {
public: public:
typedef std::list<CefRefPtr<CefBrowserHostImpl>> BrowserList;
// Interface to implement for observers that wish to be informed of changes // Interface to implement for observers that wish to be informed of changes
// to the context. All methods will be called on the UI thread. // to the context. All methods will be called on the UI thread.
class Observer { class Observer {

View File

@ -4,7 +4,7 @@
#include "libcef/browser/devtools/devtools_file_manager.h" #include "libcef/browser/devtools/devtools_file_manager.h"
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/callback.h" #include "base/callback.h"
@ -39,8 +39,9 @@ void AppendToFile(const base::FilePath& path, const std::string& content) {
} // namespace } // namespace
CefDevToolsFileManager::CefDevToolsFileManager(CefBrowserHostImpl* browser_impl, CefDevToolsFileManager::CefDevToolsFileManager(
PrefService* prefs) AlloyBrowserHostImpl* browser_impl,
PrefService* prefs)
: browser_impl_(browser_impl), : browser_impl_(browser_impl),
prefs_(prefs), prefs_(prefs),
file_task_runner_(base::CreateSequencedTaskRunner( file_task_runner_(base::CreateSequencedTaskRunner(

View File

@ -18,7 +18,7 @@ class SequencedTaskRunner;
class Value; class Value;
} // namespace base } // namespace base
class CefBrowserHostImpl; class AlloyBrowserHostImpl;
class PrefService; class PrefService;
// File management helper for DevTools. // File management helper for DevTools.
@ -26,7 +26,8 @@ class PrefService;
// chrome/browser/devtools/devtools_file_helper.cc. // chrome/browser/devtools/devtools_file_helper.cc.
class CefDevToolsFileManager { class CefDevToolsFileManager {
public: public:
CefDevToolsFileManager(CefBrowserHostImpl* browser_impl, PrefService* prefs); CefDevToolsFileManager(AlloyBrowserHostImpl* browser_impl,
PrefService* prefs);
void SaveToFile(const std::string& url, void SaveToFile(const std::string& url,
const std::string& content, const std::string& content,
@ -68,7 +69,7 @@ class CefDevToolsFileManager {
const base::Value* arg3); const base::Value* arg3);
// Guaranteed to outlive this object. // Guaranteed to outlive this object.
CefBrowserHostImpl* browser_impl_; AlloyBrowserHostImpl* browser_impl_;
PrefService* prefs_; PrefService* prefs_;
typedef std::map<std::string, base::FilePath> PathsMap; typedef std::map<std::string, base::FilePath> PathsMap;

View File

@ -235,7 +235,7 @@ const size_t kMaxMessageChunkSize = IPC::Channel::kMaximumMessageSize / 4;
// static // static
CefDevToolsFrontend* CefDevToolsFrontend::Show( CefDevToolsFrontend* CefDevToolsFrontend::Show(
CefBrowserHostImpl* inspected_browser, AlloyBrowserHostImpl* inspected_browser,
const CefWindowInfo& windowInfo, const CefWindowInfo& windowInfo,
CefRefPtr<CefClient> client, CefRefPtr<CefClient> client,
const CefBrowserSettings& settings, const CefBrowserSettings& settings,
@ -258,15 +258,15 @@ CefDevToolsFrontend* CefDevToolsFrontend::Show(
create_params.request_context = inspected_browser->GetRequestContext(); create_params.request_context = inspected_browser->GetRequestContext();
create_params.extra_info = inspected_browser->browser_info()->extra_info(); create_params.extra_info = inspected_browser->browser_info()->extra_info();
CefRefPtr<CefBrowserHostImpl> frontend_browser = CefRefPtr<AlloyBrowserHostImpl> frontend_browser =
CefBrowserHostImpl::Create(create_params); AlloyBrowserHostImpl::Create(create_params);
content::WebContents* inspected_contents = inspected_browser->web_contents(); content::WebContents* inspected_contents = inspected_browser->web_contents();
// CefDevToolsFrontend will delete itself when the frontend WebContents is // CefDevToolsFrontend will delete itself when the frontend WebContents is
// destroyed. // destroyed.
CefDevToolsFrontend* devtools_frontend = new CefDevToolsFrontend( CefDevToolsFrontend* devtools_frontend = new CefDevToolsFrontend(
static_cast<CefBrowserHostImpl*>(frontend_browser.get()), static_cast<AlloyBrowserHostImpl*>(frontend_browser.get()),
inspected_contents, inspect_element_at, inspected_contents, inspect_element_at,
std::move(frontend_destroyed_callback)); std::move(frontend_destroyed_callback));
@ -293,12 +293,12 @@ void CefDevToolsFrontend::InspectElementAt(int x, int y) {
void CefDevToolsFrontend::Close() { void CefDevToolsFrontend::Close() {
base::PostTask(FROM_HERE, {content::BrowserThread::UI}, base::PostTask(FROM_HERE, {content::BrowserThread::UI},
base::Bind(&CefBrowserHostImpl::CloseBrowser, base::Bind(&AlloyBrowserHostImpl::CloseBrowser,
frontend_browser_.get(), true)); frontend_browser_.get(), true));
} }
CefDevToolsFrontend::CefDevToolsFrontend( CefDevToolsFrontend::CefDevToolsFrontend(
CefBrowserHostImpl* frontend_browser, AlloyBrowserHostImpl* frontend_browser,
content::WebContents* inspected_contents, content::WebContents* inspected_contents,
const CefPoint& inspect_element_at, const CefPoint& inspect_element_at,
base::OnceClosure frontend_destroyed_callback) base::OnceClosure frontend_destroyed_callback)

View File

@ -7,7 +7,7 @@
#include <memory> #include <memory>
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/devtools/devtools_file_manager.h" #include "libcef/browser/devtools/devtools_file_manager.h"
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
@ -42,7 +42,7 @@ class CefDevToolsFrontend : public content::WebContentsObserver,
public content::DevToolsAgentHostClient { public content::DevToolsAgentHostClient {
public: public:
static CefDevToolsFrontend* Show( static CefDevToolsFrontend* Show(
CefBrowserHostImpl* inspected_browser, AlloyBrowserHostImpl* inspected_browser,
const CefWindowInfo& windowInfo, const CefWindowInfo& windowInfo,
CefRefPtr<CefClient> client, CefRefPtr<CefClient> client,
const CefBrowserSettings& settings, const CefBrowserSettings& settings,
@ -60,7 +60,7 @@ class CefDevToolsFrontend : public content::WebContentsObserver,
const base::Value* arg3); const base::Value* arg3);
private: private:
CefDevToolsFrontend(CefBrowserHostImpl* frontend_browser, CefDevToolsFrontend(AlloyBrowserHostImpl* frontend_browser,
content::WebContents* inspected_contents, content::WebContents* inspected_contents,
const CefPoint& inspect_element_at, const CefPoint& inspect_element_at,
base::OnceClosure destroyed_callback); base::OnceClosure destroyed_callback);
@ -87,7 +87,7 @@ class CefDevToolsFrontend : public content::WebContentsObserver,
PrefService* GetPrefs() const; PrefService* GetPrefs() const;
CefRefPtr<CefBrowserHostImpl> frontend_browser_; CefRefPtr<AlloyBrowserHostImpl> frontend_browser_;
content::WebContents* inspected_contents_; content::WebContents* inspected_contents_;
scoped_refptr<content::DevToolsAgentHost> agent_host_; scoped_refptr<content::DevToolsAgentHost> agent_host_;
CefPoint inspect_element_at_; CefPoint inspect_element_at_;

View File

@ -31,7 +31,7 @@ class CefDevToolsRegistrationImpl : public CefRegistration,
controller_->RemoveObserver(this); controller_->RemoveObserver(this);
} }
void Initialize(CefBrowserHostImpl* browser, void Initialize(AlloyBrowserHostImpl* browser,
base::WeakPtr<CefDevToolsController> controller) { base::WeakPtr<CefDevToolsController> controller) {
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
DCHECK(browser && controller); DCHECK(browser && controller);
@ -83,7 +83,7 @@ class CefDevToolsRegistrationImpl : public CefRegistration,
CefRefPtr<CefDevToolsMessageObserver> observer_; CefRefPtr<CefDevToolsMessageObserver> observer_;
CefBrowserHostImpl* browser_ = nullptr; AlloyBrowserHostImpl* browser_ = nullptr;
base::WeakPtr<CefDevToolsController> controller_; base::WeakPtr<CefDevToolsController> controller_;
IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefDevToolsRegistrationImpl); IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefDevToolsRegistrationImpl);
@ -92,7 +92,7 @@ class CefDevToolsRegistrationImpl : public CefRegistration,
} // namespace } // namespace
CefDevToolsManager::CefDevToolsManager(CefBrowserHostImpl* inspected_browser) CefDevToolsManager::CefDevToolsManager(AlloyBrowserHostImpl* inspected_browser)
: inspected_browser_(inspected_browser), weak_ptr_factory_(this) { : inspected_browser_(inspected_browser), weak_ptr_factory_(this) {
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
} }

View File

@ -10,7 +10,7 @@
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
class CefBrowserHostImpl; class AlloyBrowserHostImpl;
class CefDevToolsController; class CefDevToolsController;
class CefDevToolsFrontend; class CefDevToolsFrontend;
@ -23,7 +23,7 @@ class WebContents;
class CefDevToolsManager { class CefDevToolsManager {
public: public:
// |inspected_browser| will outlive this object. // |inspected_browser| will outlive this object.
explicit CefDevToolsManager(CefBrowserHostImpl* inspected_browser); explicit CefDevToolsManager(AlloyBrowserHostImpl* inspected_browser);
~CefDevToolsManager(); ~CefDevToolsManager();
// See CefBrowserHost methods of the same name for documentation. // See CefBrowserHost methods of the same name for documentation.
@ -52,7 +52,7 @@ class CefDevToolsManager {
bool EnsureController(); bool EnsureController();
CefBrowserHostImpl* const inspected_browser_; AlloyBrowserHostImpl* const inspected_browser_;
// CefDevToolsFrontend will delete itself when the frontend WebContents is // CefDevToolsFrontend will delete itself when the frontend WebContents is
// destroyed. // destroyed.

View File

@ -8,8 +8,6 @@
#include <vector> #include <vector>
#include "libcef/browser/browser_host_impl.h"
#include "base/atomicops.h" #include "base/atomicops.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/command_line.h" #include "base/command_line.h"

View File

@ -5,7 +5,7 @@
#include "libcef/browser/download_manager_delegate.h" #include "libcef/browser/download_manager_delegate.h"
#include "include/cef_download_handler.h" #include "include/cef_download_handler.h"
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/context.h" #include "libcef/browser/context.h"
#include "libcef/browser/download_item_impl.h" #include "libcef/browser/download_item_impl.h"
#include "libcef/browser/thread_util.h" #include "libcef/browser/thread_util.h"
@ -31,7 +31,7 @@ namespace {
// Helper function to retrieve the CefDownloadHandler. // Helper function to retrieve the CefDownloadHandler.
CefRefPtr<CefDownloadHandler> GetDownloadHandler( CefRefPtr<CefDownloadHandler> GetDownloadHandler(
CefRefPtr<CefBrowserHostImpl> browser) { CefRefPtr<AlloyBrowserHostImpl> browser) {
CefRefPtr<CefClient> client = browser->GetClient(); CefRefPtr<CefClient> client = browser->GetClient();
if (client.get()) if (client.get())
return client->GetDownloadHandler(); return client->GetDownloadHandler();
@ -125,8 +125,8 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback {
if (show_dialog) { if (show_dialog) {
WebContents* web_contents = WebContents* web_contents =
content::DownloadItemUtils::GetWebContents(item); content::DownloadItemUtils::GetWebContents(item);
CefRefPtr<CefBrowserHostImpl> browser = CefRefPtr<AlloyBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserForContents(web_contents); AlloyBrowserHostImpl::GetBrowserForContents(web_contents);
if (browser.get()) { if (browser.get()) {
handled = true; handled = true;
@ -276,7 +276,7 @@ CefDownloadManagerDelegate::~CefDownloadManagerDelegate() {
} }
void CefDownloadManagerDelegate::OnDownloadUpdated(DownloadItem* download) { void CefDownloadManagerDelegate::OnDownloadUpdated(DownloadItem* download) {
CefRefPtr<CefBrowserHostImpl> browser = GetBrowser(download); CefRefPtr<AlloyBrowserHostImpl> browser = GetBrowser(download);
CefRefPtr<CefDownloadHandler> handler; CefRefPtr<CefDownloadHandler> handler;
if (browser.get()) if (browser.get())
handler = GetDownloadHandler(browser); handler = GetDownloadHandler(browser);
@ -296,7 +296,7 @@ void CefDownloadManagerDelegate::OnDownloadUpdated(DownloadItem* download) {
void CefDownloadManagerDelegate::OnDownloadDestroyed(DownloadItem* item) { void CefDownloadManagerDelegate::OnDownloadDestroyed(DownloadItem* item) {
item->RemoveObserver(this); item->RemoveObserver(this);
CefBrowserHostImpl* browser = nullptr; AlloyBrowserHostImpl* browser = nullptr;
ItemBrowserMap::iterator it = item_browser_map_.find(item); ItemBrowserMap::iterator it = item_browser_map_.find(item);
DCHECK(it != item_browser_map_.end()); DCHECK(it != item_browser_map_.end());
@ -326,7 +326,7 @@ void CefDownloadManagerDelegate::OnDownloadCreated(DownloadManager* manager,
DownloadItem* item) { DownloadItem* item) {
// This callback may arrive after DetermineDownloadTarget, so we allow // This callback may arrive after DetermineDownloadTarget, so we allow
// association from either method. // association from either method.
CefRefPtr<CefBrowserHostImpl> browser = GetOrAssociateBrowser(item); CefRefPtr<AlloyBrowserHostImpl> browser = GetOrAssociateBrowser(item);
if (!browser) { if (!browser) {
// If the download is rejected (e.g. ALT+click on an invalid protocol link) // If the download is rejected (e.g. ALT+click on an invalid protocol link)
// then an "interrupted" download will be started via DownloadManagerImpl:: // then an "interrupted" download will be started via DownloadManagerImpl::
@ -365,7 +365,7 @@ bool CefDownloadManagerDelegate::DetermineDownloadTarget(
// This callback may arrive before OnDownloadCreated, so we allow association // This callback may arrive before OnDownloadCreated, so we allow association
// from either method. // from either method.
CefRefPtr<CefBrowserHostImpl> browser = GetOrAssociateBrowser(item); CefRefPtr<AlloyBrowserHostImpl> browser = GetOrAssociateBrowser(item);
CefRefPtr<CefDownloadHandler> handler; CefRefPtr<CefDownloadHandler> handler;
if (browser.get()) if (browser.get())
handler = GetDownloadHandler(browser); handler = GetDownloadHandler(browser);
@ -418,17 +418,17 @@ void CefDownloadManagerDelegate::OnBrowserDestroyed(
} }
} }
CefBrowserHostImpl* CefDownloadManagerDelegate::GetOrAssociateBrowser( AlloyBrowserHostImpl* CefDownloadManagerDelegate::GetOrAssociateBrowser(
download::DownloadItem* item) { download::DownloadItem* item) {
ItemBrowserMap::const_iterator it = item_browser_map_.find(item); ItemBrowserMap::const_iterator it = item_browser_map_.find(item);
if (it != item_browser_map_.end()) if (it != item_browser_map_.end())
return it->second; return it->second;
CefBrowserHostImpl* browser = nullptr; AlloyBrowserHostImpl* browser = nullptr;
content::WebContents* contents = content::WebContents* contents =
content::DownloadItemUtils::GetWebContents(item); content::DownloadItemUtils::GetWebContents(item);
if (contents) { if (contents) {
browser = CefBrowserHostImpl::GetBrowserForContents(contents).get(); browser = AlloyBrowserHostImpl::GetBrowserForContents(contents).get();
DCHECK(browser); DCHECK(browser);
} }
if (!browser) if (!browser)
@ -446,7 +446,8 @@ CefBrowserHostImpl* CefDownloadManagerDelegate::GetOrAssociateBrowser(
return browser; return browser;
} }
CefBrowserHostImpl* CefDownloadManagerDelegate::GetBrowser(DownloadItem* item) { AlloyBrowserHostImpl* CefDownloadManagerDelegate::GetBrowser(
DownloadItem* item) {
ItemBrowserMap::const_iterator it = item_browser_map_.find(item); ItemBrowserMap::const_iterator it = item_browser_map_.find(item);
if (it != item_browser_map_.end()) if (it != item_browser_map_.end())
return it->second; return it->second;

View File

@ -16,7 +16,7 @@
#include "content/public/browser/download_manager.h" #include "content/public/browser/download_manager.h"
#include "content/public/browser/download_manager_delegate.h" #include "content/public/browser/download_manager_delegate.h"
class CefBrowserHostImpl; class AlloyBrowserHostImpl;
class CefDownloadManagerDelegate : public download::DownloadItem::Observer, class CefDownloadManagerDelegate : public download::DownloadItem::Observer,
public content::DownloadManager::Observer, public content::DownloadManager::Observer,
@ -46,16 +46,17 @@ class CefDownloadManagerDelegate : public download::DownloadItem::Observer,
// CefBrowserHostBase::Observer methods. // CefBrowserHostBase::Observer methods.
void OnBrowserDestroyed(CefBrowserHostBase* browser) override; void OnBrowserDestroyed(CefBrowserHostBase* browser) override;
CefBrowserHostImpl* GetOrAssociateBrowser(download::DownloadItem* item); AlloyBrowserHostImpl* GetOrAssociateBrowser(download::DownloadItem* item);
CefBrowserHostImpl* GetBrowser(download::DownloadItem* item); AlloyBrowserHostImpl* GetBrowser(download::DownloadItem* item);
content::DownloadManager* manager_; content::DownloadManager* manager_;
base::WeakPtrFactory<content::DownloadManager> manager_ptr_factory_; base::WeakPtrFactory<content::DownloadManager> manager_ptr_factory_;
// Map of DownloadItem to originating CefBrowserHostImpl. Maintaining this // Map of DownloadItem to originating AlloyBrowserHostImpl. Maintaining this
// map is necessary because DownloadItem::GetWebContents() may return NULL if // map is necessary because DownloadItem::GetWebContents() may return NULL if
// the browser navigates while the download is in progress. // the browser navigates while the download is in progress.
typedef std::map<download::DownloadItem*, CefBrowserHostImpl*> ItemBrowserMap; typedef std::map<download::DownloadItem*, AlloyBrowserHostImpl*>
ItemBrowserMap;
ItemBrowserMap item_browser_map_; ItemBrowserMap item_browser_map_;
DISALLOW_COPY_AND_ASSIGN(CefDownloadManagerDelegate); DISALLOW_COPY_AND_ASSIGN(CefDownloadManagerDelegate);

View File

@ -119,7 +119,7 @@ ExecuteCodeFunction::InitResult ExecuteCodeInTabFunction::Init() {
// Find a browser that we can access, or fail with error. // Find a browser that we can access, or fail with error.
std::string error; std::string error;
CefRefPtr<CefBrowserHostImpl> browser = CefRefPtr<AlloyBrowserHostImpl> browser =
cef_details_.GetBrowserForTabIdFirstTime(tab_id, &error); cef_details_.GetBrowserForTabIdFirstTime(tab_id, &error);
if (!browser) if (!browser)
return set_init_result_error(error); return set_init_result_error(error);
@ -133,7 +133,7 @@ ExecuteCodeFunction::InitResult ExecuteCodeInTabFunction::Init() {
bool ExecuteCodeInTabFunction::CanExecuteScriptOnPage(std::string* error) { bool ExecuteCodeInTabFunction::CanExecuteScriptOnPage(std::string* error) {
CHECK_GE(execute_tab_id_, 0); CHECK_GE(execute_tab_id_, 0);
CefRefPtr<CefBrowserHostImpl> browser = CefRefPtr<AlloyBrowserHostImpl> browser =
cef_details_.GetBrowserForTabIdAgain(execute_tab_id_, error); cef_details_.GetBrowserForTabIdAgain(execute_tab_id_, error);
if (!browser) if (!browser)
return false; return false;
@ -188,7 +188,7 @@ ScriptExecutor* ExecuteCodeInTabFunction::GetScriptExecutor(
std::string* error) { std::string* error) {
CHECK_GE(execute_tab_id_, 0); CHECK_GE(execute_tab_id_, 0);
CefRefPtr<CefBrowserHostImpl> browser = CefRefPtr<AlloyBrowserHostImpl> browser =
cef_details_.GetBrowserForTabIdAgain(execute_tab_id_, error); cef_details_.GetBrowserForTabIdAgain(execute_tab_id_, error);
if (!browser) if (!browser)
return nullptr; return nullptr;
@ -237,7 +237,7 @@ ZoomAPIFunction::ZoomAPIFunction() : cef_details_(this) {}
content::WebContents* ZoomAPIFunction::GetWebContents(int tab_id) { content::WebContents* ZoomAPIFunction::GetWebContents(int tab_id) {
// Find a browser that we can access, or set |error_| and return nullptr. // Find a browser that we can access, or set |error_| and return nullptr.
CefRefPtr<CefBrowserHostImpl> browser = CefRefPtr<AlloyBrowserHostImpl> browser =
cef_details_.GetBrowserForTabIdFirstTime(tab_id, &error_); cef_details_.GetBrowserForTabIdFirstTime(tab_id, &error_);
if (!browser) if (!browser)
return nullptr; return nullptr;

View File

@ -4,9 +4,9 @@
#include "libcef/browser/extensions/browser_extensions_util.h" #include "libcef/browser/extensions/browser_extensions_util.h"
#include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/browser_context.h" #include "libcef/browser/browser_context.h"
#include "libcef/browser/browser_host_base.h" #include "libcef/browser/browser_host_base.h"
#include "libcef/browser/browser_host_impl.h"
#include "libcef/browser/browser_info_manager.h" #include "libcef/browser/browser_info_manager.h"
#include "libcef/browser/thread_util.h" #include "libcef/browser/thread_util.h"
#include "libcef/common/extensions/extensions_util.h" #include "libcef/common/extensions/extensions_util.h"
@ -146,7 +146,7 @@ CefRefPtr<CefBrowserHostBase> GetOwnerBrowserForHost(
return browser; return browser;
} }
CefRefPtr<CefBrowserHostImpl> GetBrowserForTabId( CefRefPtr<AlloyBrowserHostImpl> GetBrowserForTabId(
int tab_id, int tab_id,
content::BrowserContext* browser_context) { content::BrowserContext* browser_context) {
REQUIRE_ALLOY_RUNTIME(); REQUIRE_ALLOY_RUNTIME();
@ -160,8 +160,8 @@ CefRefPtr<CefBrowserHostImpl> GetBrowserForTabId(
for (const auto& browser_info : for (const auto& browser_info :
CefBrowserInfoManager::GetInstance()->GetBrowserInfoList()) { CefBrowserInfoManager::GetInstance()->GetBrowserInfoList()) {
CefRefPtr<CefBrowserHostImpl> current_browser = CefRefPtr<AlloyBrowserHostImpl> current_browser =
static_cast<CefBrowserHostImpl*>(browser_info->browser().get()); static_cast<AlloyBrowserHostImpl*>(browser_info->browser().get());
if (current_browser && current_browser->GetIdentifier() == tab_id) { if (current_browser && current_browser->GetIdentifier() == tab_id) {
// Make sure we're operating in the same CefBrowserContext. // Make sure we're operating in the same CefBrowserContext.
if (CefBrowserContext::FromBrowserContext( if (CefBrowserContext::FromBrowserContext(

View File

@ -19,7 +19,7 @@ class WebContents;
} // namespace content } // namespace content
class CefBrowserHostBase; class CefBrowserHostBase;
class CefBrowserHostImpl; class AlloyBrowserHostImpl;
namespace extensions { namespace extensions {
@ -60,7 +60,7 @@ CefRefPtr<CefBrowserHostBase> GetOwnerBrowserForHost(
// Returns the browser matching |tab_id| and |browser_context|. Returns false if // Returns the browser matching |tab_id| and |browser_context|. Returns false if
// |tab_id| is < 0 or a matching browser cannot be found within // |tab_id| is < 0 or a matching browser cannot be found within
// |browser_context|. Similar in concept to ExtensionTabUtil::GetTabById. // |browser_context|. Similar in concept to ExtensionTabUtil::GetTabById.
CefRefPtr<CefBrowserHostImpl> GetBrowserForTabId( CefRefPtr<AlloyBrowserHostImpl> GetBrowserForTabId(
int tab_id, int tab_id,
content::BrowserContext* browser_context); content::BrowserContext* browser_context);

View File

@ -6,7 +6,7 @@
#include <utility> #include <utility>
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/thread_util.h" #include "libcef/browser/thread_util.h"
#include "content/public/browser/render_view_host.h" #include "content/public/browser/render_view_host.h"
@ -27,7 +27,7 @@ void CefBrowserPlatformDelegateBackground::CloseHostWindow() {
// No host window, so continue browser destruction now. Do it asynchronously // No host window, so continue browser destruction now. Do it asynchronously
// so the call stack has a chance to unwind. // so the call stack has a chance to unwind.
CEF_POST_TASK(CEF_UIT, CEF_POST_TASK(CEF_UIT,
base::Bind(&CefBrowserHostImpl::WindowDestroyed, browser_)); base::Bind(&AlloyBrowserHostImpl::WindowDestroyed, browser_));
} }
CefWindowHandle CefBrowserPlatformDelegateBackground::GetHostWindowHandle() CefWindowHandle CefBrowserPlatformDelegateBackground::GetHostWindowHandle()

View File

@ -4,7 +4,7 @@
#include "libcef/browser/extensions/extension_background_host.h" #include "libcef/browser/extensions/extension_background_host.h"
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/extensions/extension_host_delegate.h" #include "libcef/browser/extensions/extension_host_delegate.h"
#include "base/callback.h" #include "base/callback.h"
@ -12,7 +12,7 @@
namespace extensions { namespace extensions {
CefExtensionBackgroundHost::CefExtensionBackgroundHost( CefExtensionBackgroundHost::CefExtensionBackgroundHost(
CefBrowserHostImpl* browser, AlloyBrowserHostImpl* browser,
base::OnceClosure deleted_callback, base::OnceClosure deleted_callback,
const Extension* extension, const Extension* extension,
content::WebContents* host_contents, content::WebContents* host_contents,

View File

@ -11,7 +11,7 @@
#include "base/macros.h" #include "base/macros.h"
#include "extensions/browser/extension_host.h" #include "extensions/browser/extension_host.h"
class CefBrowserHostImpl; class AlloyBrowserHostImpl;
namespace content { namespace content {
class WebContents; class WebContents;
@ -24,7 +24,7 @@ namespace extensions {
// is managed by ProcessManager. // is managed by ProcessManager.
class CefExtensionBackgroundHost : public ExtensionHost { class CefExtensionBackgroundHost : public ExtensionHost {
public: public:
CefExtensionBackgroundHost(CefBrowserHostImpl* browser, CefExtensionBackgroundHost(AlloyBrowserHostImpl* browser,
base::OnceClosure deleted_callback, base::OnceClosure deleted_callback,
const Extension* extension, const Extension* extension,
content::WebContents* host_contents, content::WebContents* host_contents,

View File

@ -143,18 +143,18 @@ Profile* CefExtensionFunctionDetails::GetProfile() const {
return Profile::FromBrowserContext(function_->browser_context()); return Profile::FromBrowserContext(function_->browser_context());
} }
CefRefPtr<CefBrowserHostImpl> CefExtensionFunctionDetails::GetSenderBrowser() CefRefPtr<AlloyBrowserHostImpl> CefExtensionFunctionDetails::GetSenderBrowser()
const { const {
content::WebContents* web_contents = function_->GetSenderWebContents(); content::WebContents* web_contents = function_->GetSenderWebContents();
if (web_contents) if (web_contents)
return CefBrowserHostImpl::GetBrowserForContents(web_contents); return AlloyBrowserHostImpl::GetBrowserForContents(web_contents);
return nullptr; return nullptr;
} }
CefRefPtr<CefBrowserHostImpl> CefExtensionFunctionDetails::GetCurrentBrowser() CefRefPtr<AlloyBrowserHostImpl> CefExtensionFunctionDetails::GetCurrentBrowser()
const { const {
// Start with the browser hosting the extension. // Start with the browser hosting the extension.
CefRefPtr<CefBrowserHostImpl> browser = GetSenderBrowser(); CefRefPtr<AlloyBrowserHostImpl> browser = GetSenderBrowser();
if (browser && browser->client()) { if (browser && browser->client()) {
CefRefPtr<CefExtensionHandler> handler = GetCefExtension()->GetHandler(); CefRefPtr<CefExtensionHandler> handler = GetCefExtension()->GetHandler();
if (handler) { if (handler) {
@ -163,8 +163,8 @@ CefRefPtr<CefBrowserHostImpl> CefExtensionFunctionDetails::GetCurrentBrowser()
handler->GetActiveBrowser(GetCefExtension(), browser.get(), handler->GetActiveBrowser(GetCefExtension(), browser.get(),
function_->include_incognito_information()); function_->include_incognito_information());
if (active_browser && active_browser != browser) { if (active_browser && active_browser != browser) {
CefRefPtr<CefBrowserHostImpl> active_browser_impl = CefRefPtr<AlloyBrowserHostImpl> active_browser_impl =
static_cast<CefBrowserHostImpl*>(active_browser.get()); static_cast<AlloyBrowserHostImpl*>(active_browser.get());
// Make sure we're operating in the same CefBrowserContext. // Make sure we're operating in the same CefBrowserContext.
if (CefBrowserContext::FromBrowserContext( if (CefBrowserContext::FromBrowserContext(
@ -187,11 +187,11 @@ CefRefPtr<CefBrowserHostImpl> CefExtensionFunctionDetails::GetCurrentBrowser()
} }
bool CefExtensionFunctionDetails::CanAccessBrowser( bool CefExtensionFunctionDetails::CanAccessBrowser(
CefRefPtr<CefBrowserHostImpl> target) const { CefRefPtr<AlloyBrowserHostImpl> target) const {
DCHECK(target); DCHECK(target);
// Start with the browser hosting the extension. // Start with the browser hosting the extension.
CefRefPtr<CefBrowserHostImpl> browser = GetSenderBrowser(); CefRefPtr<AlloyBrowserHostImpl> browser = GetSenderBrowser();
if (browser == target) { if (browser == target) {
// A sender can always access itself. // A sender can always access itself.
return true; return true;
@ -210,14 +210,14 @@ bool CefExtensionFunctionDetails::CanAccessBrowser(
return true; return true;
} }
CefRefPtr<CefBrowserHostImpl> CefRefPtr<AlloyBrowserHostImpl>
CefExtensionFunctionDetails::GetBrowserForTabIdFirstTime( CefExtensionFunctionDetails::GetBrowserForTabIdFirstTime(
int tab_id, int tab_id,
std::string* error_message) const { std::string* error_message) const {
DCHECK(!get_browser_called_first_time_); DCHECK(!get_browser_called_first_time_);
get_browser_called_first_time_ = true; get_browser_called_first_time_ = true;
CefRefPtr<CefBrowserHostImpl> browser; CefRefPtr<AlloyBrowserHostImpl> browser;
if (tab_id >= 0) { if (tab_id >= 0) {
// May be an invalid tabId or in the wrong BrowserContext. // May be an invalid tabId or in the wrong BrowserContext.
@ -243,7 +243,7 @@ CefExtensionFunctionDetails::GetBrowserForTabIdFirstTime(
return browser; return browser;
} }
CefRefPtr<CefBrowserHostImpl> CefRefPtr<AlloyBrowserHostImpl>
CefExtensionFunctionDetails::GetBrowserForTabIdAgain( CefExtensionFunctionDetails::GetBrowserForTabIdAgain(
int tab_id, int tab_id,
std::string* error_message) const { std::string* error_message) const {
@ -251,7 +251,7 @@ CefExtensionFunctionDetails::GetBrowserForTabIdAgain(
DCHECK(get_browser_called_first_time_); DCHECK(get_browser_called_first_time_);
// May return NULL during shutdown. // May return NULL during shutdown.
CefRefPtr<CefBrowserHostImpl> browser = CefRefPtr<AlloyBrowserHostImpl> browser =
GetBrowserForTabId(tab_id, function_->browser_context()); GetBrowserForTabId(tab_id, function_->browser_context());
if (!browser || !browser->web_contents()) { if (!browser || !browser->web_contents()) {
if (error_message) { if (error_message) {
@ -265,7 +265,7 @@ CefExtensionFunctionDetails::GetBrowserForTabIdAgain(
bool CefExtensionFunctionDetails::LoadFile(const std::string& file, bool CefExtensionFunctionDetails::LoadFile(const std::string& file,
LoadFileCallback callback) const { LoadFileCallback callback) const {
// Start with the browser hosting the extension. // Start with the browser hosting the extension.
CefRefPtr<CefBrowserHostImpl> browser = GetSenderBrowser(); CefRefPtr<AlloyBrowserHostImpl> browser = GetSenderBrowser();
if (browser && browser->client()) { if (browser && browser->client()) {
CefRefPtr<CefExtensionHandler> handler = GetCefExtension()->GetHandler(); CefRefPtr<CefExtensionHandler> handler = GetCefExtension()->GetHandler();
if (handler) { if (handler) {
@ -290,7 +290,7 @@ base::DictionaryValue* CefExtensionFunctionDetails::OpenTab(
const OpenTabParams& params, const OpenTabParams& params,
bool user_gesture, bool user_gesture,
std::string* error_message) const { std::string* error_message) const {
CefRefPtr<CefBrowserHostImpl> sender_browser = GetSenderBrowser(); CefRefPtr<AlloyBrowserHostImpl> sender_browser = GetSenderBrowser();
if (!sender_browser) if (!sender_browser)
return nullptr; return nullptr;
@ -301,7 +301,7 @@ base::DictionaryValue* CefExtensionFunctionDetails::OpenTab(
// CEF doesn't have the concept of windows containing tab strips so we'll // CEF doesn't have the concept of windows containing tab strips so we'll
// select an "active browser" for BrowserContext sharing instead. // select an "active browser" for BrowserContext sharing instead.
CefRefPtr<CefBrowserHostImpl> active_browser = CefRefPtr<AlloyBrowserHostImpl> active_browser =
GetBrowserForTabIdFirstTime(window_id, error_message); GetBrowserForTabIdFirstTime(window_id, error_message);
if (!active_browser) if (!active_browser)
return nullptr; return nullptr;
@ -394,8 +394,8 @@ base::DictionaryValue* CefExtensionFunctionDetails::OpenTab(
} }
// Browser creation may fail under certain rare circumstances. // Browser creation may fail under certain rare circumstances.
CefRefPtr<CefBrowserHostImpl> new_browser = CefRefPtr<AlloyBrowserHostImpl> new_browser =
CefBrowserHostImpl::Create(create_params); AlloyBrowserHostImpl::Create(create_params);
if (!new_browser) if (!new_browser)
return nullptr; return nullptr;
@ -412,7 +412,7 @@ base::DictionaryValue* CefExtensionFunctionDetails::OpenTab(
} }
std::unique_ptr<api::tabs::Tab> CefExtensionFunctionDetails::CreateTabObject( std::unique_ptr<api::tabs::Tab> CefExtensionFunctionDetails::CreateTabObject(
CefRefPtr<CefBrowserHostImpl> new_browser, CefRefPtr<AlloyBrowserHostImpl> new_browser,
int opener_browser_id, int opener_browser_id,
bool active, bool active,
int index) const { int index) const {

View File

@ -5,7 +5,7 @@
#ifndef CEF_LIBCEF_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DETAILS_H_ #ifndef CEF_LIBCEF_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DETAILS_H_
#define CEF_LIBCEF_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DETAILS_H_ #define CEF_LIBCEF_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DETAILS_H_
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "include/cef_extension.h" #include "include/cef_extension.h"
@ -36,7 +36,7 @@ class CefExtensionFunctionDetails {
// Get the "sender" browser that is hosting the extension. May return NULL // Get the "sender" browser that is hosting the extension. May return NULL
// during startup/shutdown. // during startup/shutdown.
CefRefPtr<CefBrowserHostImpl> GetSenderBrowser() const; CefRefPtr<AlloyBrowserHostImpl> GetSenderBrowser() const;
// Get the "current" browser that will be acted on by this extension function, // Get the "current" browser that will be acted on by this extension function,
// if any. When mapping from a tabId use the GetBrowserForTabId* methods // if any. When mapping from a tabId use the GetBrowserForTabId* methods
@ -57,12 +57,12 @@ class CefExtensionFunctionDetails {
// This method can return NULL if there is no matching browser, which can // This method can return NULL if there is no matching browser, which can
// happen if only incognito windows are open, or early in startup or shutdown // happen if only incognito windows are open, or early in startup or shutdown
// shutdown when there are no active windows. // shutdown when there are no active windows.
CefRefPtr<CefBrowserHostImpl> GetCurrentBrowser() const; CefRefPtr<AlloyBrowserHostImpl> GetCurrentBrowser() const;
// Returns true if the sender browser can access |target|. When mapping from a // Returns true if the sender browser can access |target|. When mapping from a
// tabId use the GetBrowserForTabId* methods instead of calling this method // tabId use the GetBrowserForTabId* methods instead of calling this method
// directly. // directly.
bool CanAccessBrowser(CefRefPtr<CefBrowserHostImpl> target) const; bool CanAccessBrowser(CefRefPtr<AlloyBrowserHostImpl> target) const;
// Returns the browser matching |tab_id| or NULL if the browser cannot be // Returns the browser matching |tab_id| or NULL if the browser cannot be
// found or does not have a WebContents. If |tab_id| is < 0 the "current" // found or does not have a WebContents. If |tab_id| is < 0 the "current"
@ -70,7 +70,7 @@ class CefExtensionFunctionDetails {
// will be set with an appropriate message on error. This method should only // will be set with an appropriate message on error. This method should only
// be called one time per extension function and will check all necessary // be called one time per extension function and will check all necessary
// client permissions. // client permissions.
CefRefPtr<CefBrowserHostImpl> GetBrowserForTabIdFirstTime( CefRefPtr<AlloyBrowserHostImpl> GetBrowserForTabIdFirstTime(
int tab_id, int tab_id,
std::string* error_message) const; std::string* error_message) const;
@ -79,7 +79,7 @@ class CefExtensionFunctionDetails {
// |error_message| can optionally be passed in and will be set with an // |error_message| can optionally be passed in and will be set with an
// appropriate message on error. This method should be called only after // appropriate message on error. This method should be called only after
// GetBrowserForTabIdFirstTime() has succeeded for the same |tab_id|. // GetBrowserForTabIdFirstTime() has succeeded for the same |tab_id|.
CefRefPtr<CefBrowserHostImpl> GetBrowserForTabIdAgain( CefRefPtr<AlloyBrowserHostImpl> GetBrowserForTabIdAgain(
int tab_id, int tab_id,
std::string* error_message) const; std::string* error_message) const;
@ -114,7 +114,7 @@ class CefExtensionFunctionDetails {
// permissions of the extension, the object may or may not include sensitive // permissions of the extension, the object may or may not include sensitive
// data such as the tab's URL. // data such as the tab's URL.
std::unique_ptr<api::tabs::Tab> CreateTabObject( std::unique_ptr<api::tabs::Tab> CreateTabObject(
CefRefPtr<CefBrowserHostImpl> new_browser, CefRefPtr<AlloyBrowserHostImpl> new_browser,
int opener_browser_id, int opener_browser_id,
bool active, bool active,
int index) const; int index) const;

View File

@ -13,7 +13,7 @@
namespace extensions { namespace extensions {
CefExtensionHostDelegate::CefExtensionHostDelegate( CefExtensionHostDelegate::CefExtensionHostDelegate(
CefBrowserHostImpl* browser) {} AlloyBrowserHostImpl* browser) {}
CefExtensionHostDelegate::~CefExtensionHostDelegate() {} CefExtensionHostDelegate::~CefExtensionHostDelegate() {}
@ -25,7 +25,7 @@ void CefExtensionHostDelegate::OnRenderViewCreatedForBackgroundPage(
content::JavaScriptDialogManager* content::JavaScriptDialogManager*
CefExtensionHostDelegate::GetJavaScriptDialogManager() { CefExtensionHostDelegate::GetJavaScriptDialogManager() {
// Never routed here from CefBrowserHostImpl. // Never routed here from AlloyBrowserHostImpl.
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
@ -45,7 +45,7 @@ void CefExtensionHostDelegate::ProcessMediaAccessRequest(
const content::MediaStreamRequest& request, const content::MediaStreamRequest& request,
content::MediaResponseCallback callback, content::MediaResponseCallback callback,
const Extension* extension) { const Extension* extension) {
// Never routed here from CefBrowserHostImpl. // Never routed here from AlloyBrowserHostImpl.
NOTREACHED(); NOTREACHED();
} }
@ -54,7 +54,7 @@ bool CefExtensionHostDelegate::CheckMediaAccessPermission(
const GURL& security_origin, const GURL& security_origin,
blink::mojom::MediaStreamType type, blink::mojom::MediaStreamType type,
const Extension* extension) { const Extension* extension) {
// Never routed here from CefBrowserHostImpl. // Never routed here from AlloyBrowserHostImpl.
NOTREACHED(); NOTREACHED();
return false; return false;
} }

View File

@ -8,13 +8,13 @@
#include "base/macros.h" #include "base/macros.h"
#include "extensions/browser/extension_host_delegate.h" #include "extensions/browser/extension_host_delegate.h"
class CefBrowserHostImpl; class AlloyBrowserHostImpl;
namespace extensions { namespace extensions {
class CefExtensionHostDelegate : public ExtensionHostDelegate { class CefExtensionHostDelegate : public ExtensionHostDelegate {
public: public:
explicit CefExtensionHostDelegate(CefBrowserHostImpl* browser); explicit CefExtensionHostDelegate(AlloyBrowserHostImpl* browser);
~CefExtensionHostDelegate() override; ~CefExtensionHostDelegate() override;
// ExtensionHostDelegate implementation. // ExtensionHostDelegate implementation.

View File

@ -21,7 +21,7 @@ using content::WebContentsObserver;
namespace extensions { namespace extensions {
CefExtensionViewHost::CefExtensionViewHost(CefBrowserHostImpl* browser, CefExtensionViewHost::CefExtensionViewHost(AlloyBrowserHostImpl* browser,
const Extension* extension, const Extension* extension,
content::WebContents* host_contents, content::WebContents* host_contents,
const GURL& url, const GURL& url,

View File

@ -12,7 +12,7 @@
#include "content/public/browser/notification_registrar.h" #include "content/public/browser/notification_registrar.h"
#include "extensions/browser/extension_host.h" #include "extensions/browser/extension_host.h"
class CefBrowserHostImpl; class AlloyBrowserHostImpl;
namespace content { namespace content {
class WebContents; class WebContents;
@ -22,12 +22,12 @@ namespace extensions {
// The ExtensionHost for an extension that backs a view in the browser UI. For // The ExtensionHost for an extension that backs a view in the browser UI. For
// example, this could be an extension popup or dialog, but not a background // example, this could be an extension popup or dialog, but not a background
// page. Object lifespan is managed by CefBrowserHostImpl. Based on // page. Object lifespan is managed by AlloyBrowserHostImpl. Based on
// chrome/browser/extensions/extension_view_host.h. // chrome/browser/extensions/extension_view_host.h.
class CefExtensionViewHost : public ExtensionHost, class CefExtensionViewHost : public ExtensionHost,
public content::NotificationObserver { public content::NotificationObserver {
public: public:
CefExtensionViewHost(CefBrowserHostImpl* browser, CefExtensionViewHost(AlloyBrowserHostImpl* browser,
const Extension* extension, const Extension* extension,
content::WebContents* host_contents, content::WebContents* host_contents,
const GURL& url, const GURL& url,

View File

@ -7,8 +7,8 @@
#include <utility> #include <utility>
#include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/browser_context.h" #include "libcef/browser/browser_context.h"
#include "libcef/browser/browser_host_impl.h"
#include "libcef/browser/extensions/component_extension_resource_manager.h" #include "libcef/browser/extensions/component_extension_resource_manager.h"
#include "libcef/browser/extensions/extension_system.h" #include "libcef/browser/extensions/extension_system.h"
#include "libcef/browser/extensions/extension_system_factory.h" #include "libcef/browser/extensions/extension_system_factory.h"
@ -269,8 +269,8 @@ bool CefExtensionsBrowserClient::CreateBackgroundExtensionHost(
// Browser creation may fail under certain rare circumstances. Fail the // Browser creation may fail under certain rare circumstances. Fail the
// background host creation in that case. // background host creation in that case.
CefRefPtr<CefBrowserHostImpl> browser = CefRefPtr<AlloyBrowserHostImpl> browser =
CefBrowserHostImpl::Create(create_params); AlloyBrowserHostImpl::Create(create_params);
if (browser) { if (browser) {
*host = browser->GetExtensionHost(); *host = browser->GetExtensionHost();
DCHECK(*host); DCHECK(*host);

View File

@ -5,9 +5,9 @@
#include "libcef/browser/extensions/mime_handler_view_guest_delegate.h" #include "libcef/browser/extensions/mime_handler_view_guest_delegate.h"
#include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/alloy/alloy_content_browser_client.h" #include "libcef/browser/alloy/alloy_content_browser_client.h"
#include "libcef/browser/browser_context.h" #include "libcef/browser/browser_context.h"
#include "libcef/browser/browser_host_impl.h"
#include "libcef/browser/browser_info.h" #include "libcef/browser/browser_info.h"
#include "libcef/browser/osr/web_contents_view_osr.h" #include "libcef/browser/osr/web_contents_view_osr.h"
@ -27,8 +27,8 @@ void CefMimeHandlerViewGuestDelegate::OverrideWebContentsCreateParams(
content::WebContents::CreateParams* params) { content::WebContents::CreateParams* params) {
DCHECK(params->guest_delegate); DCHECK(params->guest_delegate);
CefRefPtr<CefBrowserHostImpl> owner_browser = CefRefPtr<AlloyBrowserHostImpl> owner_browser =
CefBrowserHostImpl::GetBrowserForContents(owner_web_contents_); AlloyBrowserHostImpl::GetBrowserForContents(owner_web_contents_);
DCHECK(owner_browser); DCHECK(owner_browser);
if (owner_browser->IsWindowless()) { if (owner_browser->IsWindowless()) {
@ -43,8 +43,8 @@ void CefMimeHandlerViewGuestDelegate::OnGuestAttached() {
content::WebContents* web_contents = guest_->web_contents(); content::WebContents* web_contents = guest_->web_contents();
DCHECK(web_contents); DCHECK(web_contents);
CefRefPtr<CefBrowserHostImpl> owner_browser = CefRefPtr<AlloyBrowserHostImpl> owner_browser =
CefBrowserHostImpl::GetBrowserForContents(owner_web_contents_); AlloyBrowserHostImpl::GetBrowserForContents(owner_web_contents_);
DCHECK(owner_browser); DCHECK(owner_browser);
// Associate guest state information with the owner browser. // Associate guest state information with the owner browser.
@ -56,8 +56,8 @@ void CefMimeHandlerViewGuestDelegate::OnGuestDetached() {
content::WebContents* web_contents = guest_->web_contents(); content::WebContents* web_contents = guest_->web_contents();
DCHECK(web_contents); DCHECK(web_contents);
CefRefPtr<CefBrowserHostImpl> owner_browser = CefRefPtr<AlloyBrowserHostImpl> owner_browser =
CefBrowserHostImpl::GetBrowserForContents(owner_web_contents_); AlloyBrowserHostImpl::GetBrowserForContents(owner_web_contents_);
DCHECK(owner_browser); DCHECK(owner_browser);
// Disassociate guest state information with the owner browser. // Disassociate guest state information with the owner browser.
@ -78,8 +78,8 @@ bool CefMimeHandlerViewGuestDelegate::HandleContextMenu(
new_params.x += guest_coordinates.x(); new_params.x += guest_coordinates.x();
new_params.y += guest_coordinates.y(); new_params.y += guest_coordinates.y();
CefRefPtr<CefBrowserHostImpl> owner_browser = CefRefPtr<AlloyBrowserHostImpl> owner_browser =
CefBrowserHostImpl::GetBrowserForContents(owner_web_contents_); AlloyBrowserHostImpl::GetBrowserForContents(owner_web_contents_);
DCHECK(owner_browser); DCHECK(owner_browser);
return owner_browser->HandleContextMenu(web_contents, new_params); return owner_browser->HandleContextMenu(web_contents, new_params);

View File

@ -8,7 +8,7 @@
#include <utility> #include <utility>
#include "include/cef_dialog_handler.h" #include "include/cef_dialog_handler.h"
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/thread_util.h" #include "libcef/browser/thread_util.h"
#include "content/public/browser/file_select_listener.h" #include "content/public/browser/file_select_listener.h"
@ -140,7 +140,7 @@ class UploadFolderHelper
} // namespace } // namespace
CefFileDialogManager::CefFileDialogManager( CefFileDialogManager::CefFileDialogManager(
CefBrowserHostImpl* browser, AlloyBrowserHostImpl* browser,
std::unique_ptr<CefFileDialogRunner> runner) std::unique_ptr<CefFileDialogRunner> runner)
: browser_(browser), : browser_(browser),
runner_(std::move(runner)), runner_(std::move(runner)),

View File

@ -23,19 +23,19 @@ namespace net {
class DirectoryLister; class DirectoryLister;
} }
class CefBrowserHostImpl; class AlloyBrowserHostImpl;
class CefFileDialogManager { class CefFileDialogManager {
public: public:
// |runner| may be NULL if the platform doesn't implement dialogs. // |runner| may be NULL if the platform doesn't implement dialogs.
CefFileDialogManager(CefBrowserHostImpl* browser, CefFileDialogManager(AlloyBrowserHostImpl* browser,
std::unique_ptr<CefFileDialogRunner> runner); std::unique_ptr<CefFileDialogRunner> runner);
~CefFileDialogManager(); ~CefFileDialogManager();
// Delete the runner to free any platform constructs. // Delete the runner to free any platform constructs.
void Destroy(); void Destroy();
// Called from CefBrowserHostImpl::RunFileChooser. // Called from AlloyBrowserHostImpl::RunFileChooser.
// See CefBrowserHost::RunFileDialog documentation. // See CefBrowserHost::RunFileDialog documentation.
void RunFileDialog(cef_file_dialog_mode_t mode, void RunFileDialog(cef_file_dialog_mode_t mode,
const CefString& title, const CefString& title,
@ -44,7 +44,7 @@ class CefFileDialogManager {
int selected_accept_filter, int selected_accept_filter,
CefRefPtr<CefRunFileDialogCallback> callback); CefRefPtr<CefRunFileDialogCallback> callback);
// Called from CefBrowserHostImpl::RunFileChooser. // Called from AlloyBrowserHostImpl::RunFileChooser.
// See WebContentsDelegate::RunFileChooser documentation. // See WebContentsDelegate::RunFileChooser documentation.
void RunFileChooser(scoped_refptr<content::FileSelectListener> listener, void RunFileChooser(scoped_refptr<content::FileSelectListener> listener,
const blink::mojom::FileChooserParams& params); const blink::mojom::FileChooserParams& params);
@ -86,8 +86,8 @@ class CefFileDialogManager {
// Clean up state associated with the last run. // Clean up state associated with the last run.
void Cleanup(); void Cleanup();
// CefBrowserHostImpl pointer is guaranteed to outlive this object. // AlloyBrowserHostImpl pointer is guaranteed to outlive this object.
CefBrowserHostImpl* browser_; AlloyBrowserHostImpl* browser_;
std::unique_ptr<CefFileDialogRunner> runner_; std::unique_ptr<CefFileDialogRunner> runner_;

View File

@ -13,7 +13,7 @@
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "third_party/blink/public/mojom/choosers/file_chooser.mojom.h" #include "third_party/blink/public/mojom/choosers/file_chooser.mojom.h"
class CefBrowserHostImpl; class AlloyBrowserHostImpl;
class CefFileDialogRunner { class CefFileDialogRunner {
public: public:
@ -34,7 +34,7 @@ class CefFileDialogRunner {
RunFileChooserCallback; RunFileChooserCallback;
// Display the file chooser dialog. Execute |callback| on completion. // Display the file chooser dialog. Execute |callback| on completion.
virtual void Run(CefBrowserHostImpl* browser, virtual void Run(AlloyBrowserHostImpl* browser,
const FileChooserParams& params, const FileChooserParams& params,
RunFileChooserCallback callback) = 0; RunFileChooserCallback callback) = 0;

View File

@ -7,7 +7,7 @@
#include <utility> #include <utility>
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/thread_util.h" #include "libcef/browser/thread_util.h"
#include "base/bind.h" #include "base/bind.h"
@ -63,7 +63,7 @@ class CefJSDialogCallbackImpl : public CefJSDialogCallback {
} // namespace } // namespace
CefJavaScriptDialogManager::CefJavaScriptDialogManager( CefJavaScriptDialogManager::CefJavaScriptDialogManager(
CefBrowserHostImpl* browser, AlloyBrowserHostImpl* browser,
std::unique_ptr<CefJavaScriptDialogRunner> runner) std::unique_ptr<CefJavaScriptDialogRunner> runner)
: browser_(browser), : browser_(browser),
runner_(std::move(runner)), runner_(std::move(runner)),
@ -144,7 +144,7 @@ void CefJavaScriptDialogManager::RunBeforeUnloadDialog(
bool is_reload, bool is_reload,
DialogClosedCallback callback) { DialogClosedCallback callback) {
if (browser_->destruction_state() >= if (browser_->destruction_state() >=
CefBrowserHostImpl::DESTRUCTION_STATE_ACCEPTED) { AlloyBrowserHostImpl::DESTRUCTION_STATE_ACCEPTED) {
// Currently destroying the browser. Accept the unload without showing // Currently destroying the browser. Accept the unload without showing
// the prompt. // the prompt.
std::move(callback).Run(true, base::string16()); std::move(callback).Run(true, base::string16());

View File

@ -15,12 +15,12 @@
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "content/public/browser/javascript_dialog_manager.h" #include "content/public/browser/javascript_dialog_manager.h"
class CefBrowserHostImpl; class AlloyBrowserHostImpl;
class CefJavaScriptDialogManager : public content::JavaScriptDialogManager { class CefJavaScriptDialogManager : public content::JavaScriptDialogManager {
public: public:
// |runner| may be NULL if the platform doesn't implement dialogs. // |runner| may be NULL if the platform doesn't implement dialogs.
CefJavaScriptDialogManager(CefBrowserHostImpl* browser, CefJavaScriptDialogManager(AlloyBrowserHostImpl* browser,
std::unique_ptr<CefJavaScriptDialogRunner> runner); std::unique_ptr<CefJavaScriptDialogRunner> runner);
~CefJavaScriptDialogManager() override; ~CefJavaScriptDialogManager() override;
@ -48,8 +48,8 @@ class CefJavaScriptDialogManager : public content::JavaScriptDialogManager {
bool success, bool success,
const base::string16& user_input); const base::string16& user_input);
// CefBrowserHostImpl pointer is guaranteed to outlive this object. // AlloyBrowserHostImpl pointer is guaranteed to outlive this object.
CefBrowserHostImpl* browser_; AlloyBrowserHostImpl* browser_;
std::unique_ptr<CefJavaScriptDialogRunner> runner_; std::unique_ptr<CefJavaScriptDialogRunner> runner_;

View File

@ -11,7 +11,7 @@
#include "base/strings/string16.h" #include "base/strings/string16.h"
#include "content/public/common/javascript_dialog_type.h" #include "content/public/common/javascript_dialog_type.h"
class CefBrowserHostImpl; class AlloyBrowserHostImpl;
class CefJavaScriptDialogRunner { class CefJavaScriptDialogRunner {
public: public:
@ -20,7 +20,7 @@ class CefJavaScriptDialogRunner {
DialogClosedCallback; DialogClosedCallback;
// Run the dialog. Execute |callback| on completion. // Run the dialog. Execute |callback| on completion.
virtual void Run(CefBrowserHostImpl* browser, virtual void Run(AlloyBrowserHostImpl* browser,
content::JavaScriptDialogType message_type, content::JavaScriptDialogType message_type,
const base::string16& display_url, const base::string16& display_url,
const base::string16& message_text, const base::string16& message_text,

View File

@ -6,7 +6,7 @@
#include <utility> #include <utility>
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/context_menu_params_impl.h" #include "libcef/browser/context_menu_params_impl.h"
#include "libcef/browser/menu_runner.h" #include "libcef/browser/menu_runner.h"
#include "libcef/browser/thread_util.h" #include "libcef/browser/thread_util.h"
@ -86,7 +86,7 @@ class CefRunContextMenuCallbackImpl : public CefRunContextMenuCallback {
} // namespace } // namespace
CefMenuManager::CefMenuManager(CefBrowserHostImpl* browser, CefMenuManager::CefMenuManager(AlloyBrowserHostImpl* browser,
std::unique_ptr<CefMenuRunner> runner) std::unique_ptr<CefMenuRunner> runner)
: content::WebContentsObserver(browser->web_contents()), : content::WebContentsObserver(browser->web_contents()),
browser_(browser), browser_(browser),

View File

@ -19,13 +19,13 @@ class RenderFrameHost;
class WebContents; class WebContents;
} // namespace content } // namespace content
class CefBrowserHostImpl; class AlloyBrowserHostImpl;
class CefRunContextMenuCallback; class CefRunContextMenuCallback;
class CefMenuManager : public CefMenuModelImpl::Delegate, class CefMenuManager : public CefMenuModelImpl::Delegate,
public content::WebContentsObserver { public content::WebContentsObserver {
public: public:
CefMenuManager(CefBrowserHostImpl* browser, CefMenuManager(AlloyBrowserHostImpl* browser,
std::unique_ptr<CefMenuRunner> runner); std::unique_ptr<CefMenuRunner> runner);
~CefMenuManager() override; ~CefMenuManager() override;
@ -59,8 +59,8 @@ class CefMenuManager : public CefMenuModelImpl::Delegate,
// Returns true if the specified id is a custom context menu command. // Returns true if the specified id is a custom context menu command.
bool IsCustomContextMenuCommand(int command_id); bool IsCustomContextMenuCommand(int command_id);
// CefBrowserHostImpl pointer is guaranteed to outlive this object. // AlloyBrowserHostImpl pointer is guaranteed to outlive this object.
CefBrowserHostImpl* browser_; AlloyBrowserHostImpl* browser_;
std::unique_ptr<CefMenuRunner> runner_; std::unique_ptr<CefMenuRunner> runner_;

View File

@ -14,13 +14,13 @@ namespace content {
struct ContextMenuParams; struct ContextMenuParams;
} }
class CefBrowserHostImpl; class AlloyBrowserHostImpl;
class CefMenuModelImpl; class CefMenuModelImpl;
// Provides platform-specific menu implementations for CefMenuCreator. // Provides platform-specific menu implementations for CefMenuCreator.
class CefMenuRunner { class CefMenuRunner {
public: public:
virtual bool RunContextMenu(CefBrowserHostImpl* browser, virtual bool RunContextMenu(AlloyBrowserHostImpl* browser,
CefMenuModelImpl* model, CefMenuModelImpl* model,
const content::ContextMenuParams& params) = 0; const content::ContextMenuParams& params) = 0;
virtual void CancelContextMenu() {} virtual void CancelContextMenu() {}

View File

@ -4,7 +4,7 @@
#include "libcef/browser/native/browser_platform_delegate_native.h" #include "libcef/browser/native/browser_platform_delegate_native.h"
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "content/public/browser/render_view_host.h" #include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host.h" #include "content/public/browser/render_widget_host.h"

View File

@ -6,7 +6,7 @@
#include <sys/sysinfo.h> #include <sys/sysinfo.h>
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/context.h" #include "libcef/browser/context.h"
#include "libcef/browser/native/menu_runner_linux.h" #include "libcef/browser/native/menu_runner_linux.h"
#include "libcef/browser/native/window_delegate_view.h" #include "libcef/browser/native/window_delegate_view.h"
@ -50,7 +50,7 @@ CefBrowserPlatformDelegateNativeLinux::CefBrowserPlatformDelegateNativeLinux(
window_widget_(nullptr) {} window_widget_(nullptr) {}
void CefBrowserPlatformDelegateNativeLinux::BrowserDestroyed( void CefBrowserPlatformDelegateNativeLinux::BrowserDestroyed(
CefBrowserHostImpl* browser) { AlloyBrowserHostImpl* browser) {
CefBrowserPlatformDelegateNative::BrowserDestroyed(browser); CefBrowserPlatformDelegateNative::BrowserDestroyed(browser);
if (host_window_created_) { if (host_window_created_) {

View File

@ -19,7 +19,7 @@ class CefBrowserPlatformDelegateNativeLinux
SkColor background_color); SkColor background_color);
// CefBrowserPlatformDelegate methods: // CefBrowserPlatformDelegate methods:
void BrowserDestroyed(CefBrowserHostImpl* browser) override; void BrowserDestroyed(AlloyBrowserHostImpl* browser) override;
bool CreateHostWindow() override; bool CreateHostWindow() override;
void CloseHostWindow() override; void CloseHostWindow() override;
CefWindowHandle GetHostWindowHandle() const override; CefWindowHandle GetHostWindowHandle() const override;

View File

@ -19,7 +19,7 @@ class CefBrowserPlatformDelegateNativeMac
SkColor background_color); SkColor background_color);
// CefBrowserPlatformDelegate methods: // CefBrowserPlatformDelegate methods:
void BrowserDestroyed(CefBrowserHostImpl* browser) override; void BrowserDestroyed(AlloyBrowserHostImpl* browser) override;
bool CreateHostWindow() override; bool CreateHostWindow() override;
void CloseHostWindow() override; void CloseHostWindow() override;
CefWindowHandle GetHostWindowHandle() const override; CefWindowHandle GetHostWindowHandle() const override;

View File

@ -7,7 +7,7 @@
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#import <CoreServices/CoreServices.h> #import <CoreServices/CoreServices.h>
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/context.h" #include "libcef/browser/context.h"
#include "libcef/browser/native/file_dialog_runner_mac.h" #include "libcef/browser/native/file_dialog_runner_mac.h"
#include "libcef/browser/native/javascript_dialog_runner_mac.h" #include "libcef/browser/native/javascript_dialog_runner_mac.h"
@ -34,10 +34,10 @@
// the view is deleted. // the view is deleted.
@interface CefBrowserHostView : NSView { @interface CefBrowserHostView : NSView {
@private @private
CefBrowserHostImpl* browser_; // weak AlloyBrowserHostImpl* browser_; // weak
} }
@property(nonatomic, assign) CefBrowserHostImpl* browser; @property(nonatomic, assign) AlloyBrowserHostImpl* browser;
@end @end
@ -60,15 +60,17 @@
// Receives notifications from the browser window. Will delete itself when done. // Receives notifications from the browser window. Will delete itself when done.
@interface CefWindowDelegate : NSObject <NSWindowDelegate> { @interface CefWindowDelegate : NSObject <NSWindowDelegate> {
@private @private
CefBrowserHostImpl* browser_; // weak AlloyBrowserHostImpl* browser_; // weak
NSWindow* window_; NSWindow* window_;
} }
- (id)initWithWindow:(NSWindow*)window andBrowser:(CefBrowserHostImpl*)browser; - (id)initWithWindow:(NSWindow*)window
andBrowser:(AlloyBrowserHostImpl*)browser;
@end @end
@implementation CefWindowDelegate @implementation CefWindowDelegate
- (id)initWithWindow:(NSWindow*)window andBrowser:(CefBrowserHostImpl*)browser { - (id)initWithWindow:(NSWindow*)window
andBrowser:(AlloyBrowserHostImpl*)browser {
if (self = [super init]) { if (self = [super init]) {
window_ = window; window_ = window;
browser_ = browser; browser_ = browser;
@ -150,7 +152,7 @@ CefBrowserPlatformDelegateNativeMac::CefBrowserPlatformDelegateNativeMac(
host_window_created_(false) {} host_window_created_(false) {}
void CefBrowserPlatformDelegateNativeMac::BrowserDestroyed( void CefBrowserPlatformDelegateNativeMac::BrowserDestroyed(
CefBrowserHostImpl* browser) { AlloyBrowserHostImpl* browser) {
CefBrowserPlatformDelegateNative::BrowserDestroyed(browser); CefBrowserPlatformDelegateNative::BrowserDestroyed(browser);
if (host_window_created_) { if (host_window_created_) {

View File

@ -8,7 +8,7 @@
#include <wininet.h> #include <wininet.h>
#include <winspool.h> #include <winspool.h>
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/context.h" #include "libcef/browser/context.h"
#include "libcef/browser/native/file_dialog_runner_win.h" #include "libcef/browser/native/file_dialog_runner_win.h"
#include "libcef/browser/native/javascript_dialog_runner_win.h" #include "libcef/browser/native/javascript_dialog_runner_win.h"
@ -132,7 +132,7 @@ CefBrowserPlatformDelegateNativeWin::CefBrowserPlatformDelegateNativeWin(
window_widget_(nullptr) {} window_widget_(nullptr) {}
void CefBrowserPlatformDelegateNativeWin::BrowserDestroyed( void CefBrowserPlatformDelegateNativeWin::BrowserDestroyed(
CefBrowserHostImpl* browser) { AlloyBrowserHostImpl* browser) {
CefBrowserPlatformDelegateNative::BrowserDestroyed(browser); CefBrowserPlatformDelegateNative::BrowserDestroyed(browser);
if (host_window_created_) { if (host_window_created_) {
@ -530,7 +530,7 @@ LRESULT CALLBACK CefBrowserPlatformDelegateNativeWin::WndProc(HWND hwnd,
WPARAM wParam, WPARAM wParam,
LPARAM lParam) { LPARAM lParam) {
CefBrowserPlatformDelegateNativeWin* platform_delegate = nullptr; CefBrowserPlatformDelegateNativeWin* platform_delegate = nullptr;
CefBrowserHostImpl* browser = nullptr; AlloyBrowserHostImpl* browser = nullptr;
if (message != WM_NCCREATE) { if (message != WM_NCCREATE) {
platform_delegate = static_cast<CefBrowserPlatformDelegateNativeWin*>( platform_delegate = static_cast<CefBrowserPlatformDelegateNativeWin*>(

View File

@ -17,7 +17,7 @@ class CefBrowserPlatformDelegateNativeWin
SkColor background_color); SkColor background_color);
// CefBrowserPlatformDelegate methods: // CefBrowserPlatformDelegate methods:
void BrowserDestroyed(CefBrowserHostImpl* browser) override; void BrowserDestroyed(AlloyBrowserHostImpl* browser) override;
bool CreateHostWindow() override; bool CreateHostWindow() override;
void CloseHostWindow() override; void CloseHostWindow() override;
CefWindowHandle GetHostWindowHandle() const override; CefWindowHandle GetHostWindowHandle() const override;

View File

@ -18,7 +18,7 @@ class CefFileDialogRunnerMac : public CefFileDialogRunner {
CefFileDialogRunnerMac(); CefFileDialogRunnerMac();
// CefFileDialogRunner methods: // CefFileDialogRunner methods:
void Run(CefBrowserHostImpl* browser, void Run(AlloyBrowserHostImpl* browser,
const FileChooserParams& params, const FileChooserParams& params,
RunFileChooserCallback callback) override; RunFileChooserCallback callback) override;

View File

@ -8,7 +8,7 @@
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#import <CoreServices/CoreServices.h> #import <CoreServices/CoreServices.h>
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "base/mac/mac_util.h" #include "base/mac/mac_util.h"
#include "base/stl_util.h" #include "base/stl_util.h"
@ -231,7 +231,7 @@ void AddFilters(NSPopUpButton* button,
CefFileDialogRunnerMac::CefFileDialogRunnerMac() : weak_ptr_factory_(this) {} CefFileDialogRunnerMac::CefFileDialogRunnerMac() : weak_ptr_factory_(this) {}
void CefFileDialogRunnerMac::Run(CefBrowserHostImpl* browser, void CefFileDialogRunnerMac::Run(AlloyBrowserHostImpl* browser,
const FileChooserParams& params, const FileChooserParams& params,
RunFileChooserCallback callback) { RunFileChooserCallback callback) {
callback_ = std::move(callback); callback_ = std::move(callback);

View File

@ -11,7 +11,7 @@
#include <shlobj.h> #include <shlobj.h>
#include <wrl/client.h> #include <wrl/client.h>
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/stl_util.h" #include "base/stl_util.h"
@ -517,7 +517,7 @@ bool RunSaveFileDialog(const CefFileDialogRunner::FileChooserParams& params,
CefFileDialogRunnerWin::CefFileDialogRunnerWin() {} CefFileDialogRunnerWin::CefFileDialogRunnerWin() {}
void CefFileDialogRunnerWin::Run(CefBrowserHostImpl* browser, void CefFileDialogRunnerWin::Run(AlloyBrowserHostImpl* browser,
const FileChooserParams& params, const FileChooserParams& params,
RunFileChooserCallback callback) { RunFileChooserCallback callback) {
int filter_index = params.selected_accept_filter; int filter_index = params.selected_accept_filter;

View File

@ -14,7 +14,7 @@ class CefFileDialogRunnerWin : public CefFileDialogRunner {
CefFileDialogRunnerWin(); CefFileDialogRunnerWin();
// CefFileDialogRunner methods: // CefFileDialogRunner methods:
void Run(CefBrowserHostImpl* browser, void Run(AlloyBrowserHostImpl* browser,
const FileChooserParams& params, const FileChooserParams& params,
RunFileChooserCallback callback) override; RunFileChooserCallback callback) override;
}; };

View File

@ -24,7 +24,7 @@ class CefJavaScriptDialogRunnerMac : public CefJavaScriptDialogRunner {
~CefJavaScriptDialogRunnerMac() override; ~CefJavaScriptDialogRunnerMac() override;
// CefJavaScriptDialogRunner methods: // CefJavaScriptDialogRunner methods:
void Run(CefBrowserHostImpl* browser, void Run(AlloyBrowserHostImpl* browser,
content::JavaScriptDialogType message_type, content::JavaScriptDialogType message_type,
const base::string16& display_url, const base::string16& display_url,
const base::string16& message_text, const base::string16& message_text,

View File

@ -87,7 +87,7 @@ CefJavaScriptDialogRunnerMac::~CefJavaScriptDialogRunnerMac() {
} }
void CefJavaScriptDialogRunnerMac::Run( void CefJavaScriptDialogRunnerMac::Run(
CefBrowserHostImpl* browser, AlloyBrowserHostImpl* browser,
content::JavaScriptDialogType message_type, content::JavaScriptDialogType message_type,
const base::string16& display_url, const base::string16& display_url,
const base::string16& message_text, const base::string16& message_text,

View File

@ -5,7 +5,7 @@
#include "libcef/browser/native/javascript_dialog_runner_win.h" #include "libcef/browser/native/javascript_dialog_runner_win.h"
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef_dll/resource.h" #include "libcef_dll/resource.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
@ -91,7 +91,7 @@ CefJavaScriptDialogRunnerWin::~CefJavaScriptDialogRunnerWin() {
} }
void CefJavaScriptDialogRunnerWin::Run( void CefJavaScriptDialogRunnerWin::Run(
CefBrowserHostImpl* browser, AlloyBrowserHostImpl* browser,
content::JavaScriptDialogType message_type, content::JavaScriptDialogType message_type,
const base::string16& display_url, const base::string16& display_url,
const base::string16& message_text, const base::string16& message_text,

View File

@ -17,7 +17,7 @@ class CefJavaScriptDialogRunnerWin : public CefJavaScriptDialogRunner {
~CefJavaScriptDialogRunnerWin() override; ~CefJavaScriptDialogRunnerWin() override;
// CefJavaScriptDialogRunner methods: // CefJavaScriptDialogRunner methods:
void Run(CefBrowserHostImpl* browser, void Run(AlloyBrowserHostImpl* browser,
content::JavaScriptDialogType message_type, content::JavaScriptDialogType message_type,
const base::string16& display_url, const base::string16& display_url,
const base::string16& message_text, const base::string16& message_text,

View File

@ -4,7 +4,7 @@
#include "libcef/browser/native/menu_runner_linux.h" #include "libcef/browser/native/menu_runner_linux.h"
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
@ -13,7 +13,7 @@
CefMenuRunnerLinux::CefMenuRunnerLinux() {} CefMenuRunnerLinux::CefMenuRunnerLinux() {}
bool CefMenuRunnerLinux::RunContextMenu( bool CefMenuRunnerLinux::RunContextMenu(
CefBrowserHostImpl* browser, AlloyBrowserHostImpl* browser,
CefMenuModelImpl* model, CefMenuModelImpl* model,
const content::ContextMenuParams& params) { const content::ContextMenuParams& params) {
menu_.reset( menu_.reset(

View File

@ -15,7 +15,7 @@ class CefMenuRunnerLinux : public CefMenuRunner {
CefMenuRunnerLinux(); CefMenuRunnerLinux();
// CefMenuRunner methods. // CefMenuRunner methods.
bool RunContextMenu(CefBrowserHostImpl* browser, bool RunContextMenu(AlloyBrowserHostImpl* browser,
CefMenuModelImpl* model, CefMenuModelImpl* model,
const content::ContextMenuParams& params) override; const content::ContextMenuParams& params) override;
void CancelContextMenu() override; void CancelContextMenu() override;

View File

@ -22,7 +22,7 @@ class CefMenuRunnerMac : public CefMenuRunner {
~CefMenuRunnerMac() override; ~CefMenuRunnerMac() override;
// CefMenuRunner methods. // CefMenuRunner methods.
bool RunContextMenu(CefBrowserHostImpl* browser, bool RunContextMenu(AlloyBrowserHostImpl* browser,
CefMenuModelImpl* model, CefMenuModelImpl* model,
const content::ContextMenuParams& params) override; const content::ContextMenuParams& params) override;
void CancelContextMenu() override; void CancelContextMenu() override;

View File

@ -4,7 +4,7 @@
#include "libcef/browser/native/menu_runner_mac.h" #include "libcef/browser/native/menu_runner_mac.h"
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#import "base/mac/scoped_sending_event.h" #import "base/mac/scoped_sending_event.h"
@ -17,7 +17,7 @@ CefMenuRunnerMac::CefMenuRunnerMac() {}
CefMenuRunnerMac::~CefMenuRunnerMac() {} CefMenuRunnerMac::~CefMenuRunnerMac() {}
bool CefMenuRunnerMac::RunContextMenu( bool CefMenuRunnerMac::RunContextMenu(
CefBrowserHostImpl* browser, AlloyBrowserHostImpl* browser,
CefMenuModelImpl* model, CefMenuModelImpl* model,
const content::ContextMenuParams& params) { const content::ContextMenuParams& params) {
// Create a menu controller based on the model. // Create a menu controller based on the model.

View File

@ -4,7 +4,7 @@
#include "libcef/browser/native/menu_runner_win.h" #include "libcef/browser/native/menu_runner_win.h"
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/native/menu_2.h" #include "libcef/browser/native/menu_2.h"
#include "base/task/current_thread.h" #include "base/task/current_thread.h"
@ -13,7 +13,7 @@
CefMenuRunnerWin::CefMenuRunnerWin() {} CefMenuRunnerWin::CefMenuRunnerWin() {}
bool CefMenuRunnerWin::RunContextMenu( bool CefMenuRunnerWin::RunContextMenu(
CefBrowserHostImpl* browser, AlloyBrowserHostImpl* browser,
CefMenuModelImpl* model, CefMenuModelImpl* model,
const content::ContextMenuParams& params) { const content::ContextMenuParams& params) {
// Create a menu based on the model. // Create a menu based on the model.

View File

@ -15,7 +15,7 @@ class CefMenuRunnerWin : public CefMenuRunner {
CefMenuRunnerWin(); CefMenuRunnerWin();
// CefMenuRunner methods. // CefMenuRunner methods.
bool RunContextMenu(CefBrowserHostImpl* browser, bool RunContextMenu(AlloyBrowserHostImpl* browser,
CefMenuModelImpl* model, CefMenuModelImpl* model,
const content::ContextMenuParams& params) override; const content::ContextMenuParams& params) override;

View File

@ -47,7 +47,7 @@ void CefWindowDelegateView::Init(gfx::AcceleratedWidget parent_widget,
// Tell Aura not to draw the window frame on resize. // Tell Aura not to draw the window frame on resize.
params.remove_standard_frame = true; params.remove_standard_frame = true;
// Cause WidgetDelegate::CanActivate to return true. See comments in // Cause WidgetDelegate::CanActivate to return true. See comments in
// CefBrowserHostImpl::PlatformSetFocus. // AlloyBrowserHostImpl::PlatformSetFocus.
params.activatable = views::Widget::InitParams::ACTIVATABLE_YES; params.activatable = views::Widget::InitParams::ACTIVATABLE_YES;
params.z_order = always_on_top_ ? ui::ZOrderLevel::kFloatingWindow params.z_order = always_on_top_ ? ui::ZOrderLevel::kFloatingWindow

View File

@ -92,7 +92,7 @@ CEF_EXPORT XDisplay* cef_get_xdisplay() {
return gfx::GetXDisplay(); return gfx::GetXDisplay();
} }
CefWindowX11::CefWindowX11(CefRefPtr<CefBrowserHostImpl> browser, CefWindowX11::CefWindowX11(CefRefPtr<AlloyBrowserHostImpl> browser,
::Window parent_xwindow, ::Window parent_xwindow,
const gfx::Rect& bounds, const gfx::Rect& bounds,
const std::string& title) const std::string& title)

View File

@ -12,7 +12,7 @@ typedef unsigned long Window;
struct _XDisplay; struct _XDisplay;
typedef struct _XDisplay Display; typedef struct _XDisplay Display;
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "ui/events/platform/platform_event_dispatcher.h" #include "ui/events/platform/platform_event_dispatcher.h"
@ -29,7 +29,7 @@ class DesktopWindowTreeHostLinux;
class CefWindowX11 : public ui::PlatformEventDispatcher, class CefWindowX11 : public ui::PlatformEventDispatcher,
public ui::XEventDispatcher { public ui::XEventDispatcher {
public: public:
CefWindowX11(CefRefPtr<CefBrowserHostImpl> browser, CefWindowX11(CefRefPtr<AlloyBrowserHostImpl> browser,
::Window parent_xwindow, ::Window parent_xwindow,
const gfx::Rect& bounds, const gfx::Rect& bounds,
const std::string& title); const std::string& title);
@ -69,7 +69,7 @@ class CefWindowX11 : public ui::PlatformEventDispatcher,
bool IsTargetedBy(const x11::Event& x11_event) const; bool IsTargetedBy(const x11::Event& x11_event) const;
void ProcessXEvent(x11::Event* xev); void ProcessXEvent(x11::Event* xev);
CefRefPtr<CefBrowserHostImpl> browser_; CefRefPtr<AlloyBrowserHostImpl> browser_;
// The display and the native X window hosting the root window. // The display and the native X window hosting the root window.
::Display* xdisplay_; ::Display* xdisplay_;

View File

@ -4,7 +4,7 @@
#include "libcef/browser/net_service/login_delegate.h" #include "libcef/browser/net_service/login_delegate.h"
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/net_service/browser_urlrequest_impl.h" #include "libcef/browser/net_service/browser_urlrequest_impl.h"
#include "libcef/browser/thread_util.h" #include "libcef/browser/thread_util.h"
@ -67,7 +67,7 @@ class AuthCallbackImpl : public CefAuthCallback {
}; };
void RunCallbackOnIOThread( void RunCallbackOnIOThread(
CefRefPtr<CefBrowserHostImpl> browser, CefRefPtr<AlloyBrowserHostImpl> browser,
base::Optional<CefBrowserURLRequest::RequestInfo> url_request_info, base::Optional<CefBrowserURLRequest::RequestInfo> url_request_info,
const net::AuthChallengeInfo& auth_info, const net::AuthChallengeInfo& auth_info,
const GURL& origin_url, const GURL& origin_url,
@ -119,9 +119,9 @@ LoginDelegate::LoginDelegate(const net::AuthChallengeInfo& auth_info,
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
// May be nullptr for requests originating from CefURLRequest. // May be nullptr for requests originating from CefURLRequest.
CefRefPtr<CefBrowserHostImpl> browser; CefRefPtr<AlloyBrowserHostImpl> browser;
if (web_contents) { if (web_contents) {
browser = CefBrowserHostImpl::GetBrowserForContents(web_contents); browser = AlloyBrowserHostImpl::GetBrowserForContents(web_contents);
} }
// |callback| needs to be executed asynchronously. // |callback| needs to be executed asynchronously.
@ -146,7 +146,7 @@ void LoginDelegate::Cancel() {
} }
} }
void LoginDelegate::Start(CefRefPtr<CefBrowserHostImpl> browser, void LoginDelegate::Start(CefRefPtr<AlloyBrowserHostImpl> browser,
const net::AuthChallengeInfo& auth_info, const net::AuthChallengeInfo& auth_info,
const content::GlobalRequestID& request_id, const content::GlobalRequestID& request_id,
const GURL& origin_url) { const GURL& origin_url) {

View File

@ -17,7 +17,7 @@ struct GlobalRequestID;
class WebContents; class WebContents;
} // namespace content } // namespace content
class CefBrowserHostImpl; class AlloyBrowserHostImpl;
class GURL; class GURL;
namespace net_service { namespace net_service {
@ -36,7 +36,7 @@ class LoginDelegate : public content::LoginDelegate {
void Cancel(); void Cancel();
private: private:
void Start(CefRefPtr<CefBrowserHostImpl> browser, void Start(CefRefPtr<AlloyBrowserHostImpl> browser,
const net::AuthChallengeInfo& auth_info, const net::AuthChallengeInfo& auth_info,
const content::GlobalRequestID& request_id, const content::GlobalRequestID& request_id,
const GURL& origin_url); const GURL& origin_url);

View File

@ -6,7 +6,7 @@
#include <utility> #include <utility>
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/image_impl.h" #include "libcef/browser/image_impl.h"
#include "libcef/browser/osr/osr_accessibility_util.h" #include "libcef/browser/osr/osr_accessibility_util.h"
#include "libcef/browser/osr/render_widget_host_view_osr.h" #include "libcef/browser/osr/render_widget_host_view_osr.h"
@ -60,7 +60,7 @@ void CefBrowserPlatformDelegateOsr::RenderViewCreated(
} }
void CefBrowserPlatformDelegateOsr::BrowserCreated( void CefBrowserPlatformDelegateOsr::BrowserCreated(
CefBrowserHostImpl* browser) { AlloyBrowserHostImpl* browser) {
CefBrowserPlatformDelegateAlloy::BrowserCreated(browser); CefBrowserPlatformDelegateAlloy::BrowserCreated(browser);
if (browser->IsPopup()) { if (browser->IsPopup()) {
@ -92,7 +92,7 @@ void CefBrowserPlatformDelegateOsr::NotifyBrowserDestroyed() {
} }
void CefBrowserPlatformDelegateOsr::BrowserDestroyed( void CefBrowserPlatformDelegateOsr::BrowserDestroyed(
CefBrowserHostImpl* browser) { AlloyBrowserHostImpl* browser) {
CefBrowserPlatformDelegateAlloy::BrowserDestroyed(browser); CefBrowserPlatformDelegateAlloy::BrowserDestroyed(browser);
view_osr_ = nullptr; view_osr_ = nullptr;

View File

@ -27,9 +27,9 @@ class CefBrowserPlatformDelegateOsr
void WebContentsCreated(content::WebContents* web_contents, void WebContentsCreated(content::WebContents* web_contents,
bool owned) override; bool owned) override;
void RenderViewCreated(content::RenderViewHost* render_view_host) override; void RenderViewCreated(content::RenderViewHost* render_view_host) override;
void BrowserCreated(CefBrowserHostImpl* browser) override; void BrowserCreated(AlloyBrowserHostImpl* browser) override;
void NotifyBrowserDestroyed() override; void NotifyBrowserDestroyed() override;
void BrowserDestroyed(CefBrowserHostImpl* browser) override; void BrowserDestroyed(AlloyBrowserHostImpl* browser) override;
SkColor GetBackgroundColor() const override; SkColor GetBackgroundColor() const override;
void WasResized() override; void WasResized() override;
void SendKeyEvent(const CefKeyEvent& event) override; void SendKeyEvent(const CefKeyEvent& event) override;

View File

@ -6,8 +6,6 @@
#include <utility> #include <utility>
#include "libcef/browser/browser_host_impl.h"
CefBrowserPlatformDelegateOsrLinux::CefBrowserPlatformDelegateOsrLinux( CefBrowserPlatformDelegateOsrLinux::CefBrowserPlatformDelegateOsrLinux(
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate, std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate,
bool use_external_begin_frame) bool use_external_begin_frame)

View File

@ -6,9 +6,6 @@
#include <utility> #include <utility>
#include "libcef/browser/browser_host_impl.h"
#include "libcef/browser/osr/render_widget_host_view_osr.h"
CefBrowserPlatformDelegateOsrMac::CefBrowserPlatformDelegateOsrMac( CefBrowserPlatformDelegateOsrMac::CefBrowserPlatformDelegateOsrMac(
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate) std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate)
: CefBrowserPlatformDelegateOsr(std::move(native_delegate), : CefBrowserPlatformDelegateOsr(std::move(native_delegate),

View File

@ -6,8 +6,6 @@
#include <utility> #include <utility>
#include "libcef/browser/browser_host_impl.h"
CefBrowserPlatformDelegateOsrWin::CefBrowserPlatformDelegateOsrWin( CefBrowserPlatformDelegateOsrWin::CefBrowserPlatformDelegateOsrWin(
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate, std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate,
bool use_shared_texture, bool use_shared_texture,

View File

@ -6,7 +6,6 @@
#include <utility> #include <utility>
#include "libcef/browser/browser_host_impl.h"
#include "libcef/browser/osr/render_widget_host_view_osr.h" #include "libcef/browser/osr/render_widget_host_view_osr.h"
#include "base/memory/shared_memory_mapping.h" #include "base/memory/shared_memory_mapping.h"

View File

@ -9,7 +9,7 @@
#include <utility> #include <utility>
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/osr/osr_util.h" #include "libcef/browser/osr/osr_util.h"
#include "libcef/browser/osr/synthetic_gesture_target_osr.h" #include "libcef/browser/osr/synthetic_gesture_target_osr.h"
#include "libcef/browser/osr/video_consumer_osr.h" #include "libcef/browser/osr/video_consumer_osr.h"
@ -146,7 +146,7 @@ ui::LatencyInfo CreateLatencyInfo(const blink::WebInputEvent& event) {
return latency_info; return latency_info;
} }
gfx::Rect GetViewBounds(CefBrowserHostImpl* browser) { gfx::Rect GetViewBounds(AlloyBrowserHostImpl* browser) {
if (!browser) if (!browser)
return gfx::Rect(); return gfx::Rect();
@ -162,7 +162,7 @@ gfx::Rect GetViewBounds(CefBrowserHostImpl* browser) {
return gfx::Rect(rc.x, rc.y, rc.width, rc.height); return gfx::Rect(rc.x, rc.y, rc.width, rc.height);
} }
float GetDeviceScaleFactor(CefBrowserHostImpl* browser) { float GetDeviceScaleFactor(AlloyBrowserHostImpl* browser) {
if (!browser) if (!browser)
return kDefaultScaleFactor; return kDefaultScaleFactor;
@ -231,8 +231,8 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
browser_impl_ = parent_host_view_->browser_impl(); browser_impl_ = parent_host_view_->browser_impl();
DCHECK(browser_impl_); DCHECK(browser_impl_);
} else if (content::RenderViewHost::From(render_widget_host_)) { } else if (content::RenderViewHost::From(render_widget_host_)) {
// CefBrowserHostImpl might not be created at this time for popups. // AlloyBrowserHostImpl might not be created at this time for popups.
browser_impl_ = CefBrowserHostImpl::GetBrowserForHost( browser_impl_ = AlloyBrowserHostImpl::GetBrowserForHost(
content::RenderViewHost::From(render_widget_host_)); content::RenderViewHost::From(render_widget_host_));
} }
@ -1517,7 +1517,7 @@ ui::Layer* CefRenderWidgetHostViewOSR::GetRootLayer() const {
} }
void CefRenderWidgetHostViewOSR::SetFrameRate() { void CefRenderWidgetHostViewOSR::SetFrameRate() {
CefRefPtr<CefBrowserHostImpl> browser; CefRefPtr<AlloyBrowserHostImpl> browser;
if (parent_host_view_) { if (parent_host_view_) {
// Use the same frame rate as the embedding browser. // Use the same frame rate as the embedding browser.
browser = parent_host_view_->browser_impl_; browser = parent_host_view_->browser_impl_;

View File

@ -14,7 +14,7 @@
#include "include/cef_base.h" #include "include/cef_base.h"
#include "include/cef_browser.h" #include "include/cef_browser.h"
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/osr/host_display_client_osr.h" #include "libcef/browser/osr/host_display_client_osr.h"
#include "libcef/browser/osr/motion_event_osr.h" #include "libcef/browser/osr/motion_event_osr.h"
@ -242,8 +242,8 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
void ImeFinishComposingText(bool keep_selection); void ImeFinishComposingText(bool keep_selection);
void ImeCancelComposition() override; void ImeCancelComposition() override;
CefRefPtr<CefBrowserHostImpl> browser_impl() const { return browser_impl_; } CefRefPtr<AlloyBrowserHostImpl> browser_impl() const { return browser_impl_; }
void set_browser_impl(CefRefPtr<CefBrowserHostImpl> browser) { void set_browser_impl(CefRefPtr<AlloyBrowserHostImpl> browser) {
browser_impl_ = browser; browser_impl_ = browser;
} }
@ -378,7 +378,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
CefRenderWidgetHostViewOSR* child_host_view_ = nullptr; CefRenderWidgetHostViewOSR* child_host_view_ = nullptr;
std::set<CefRenderWidgetHostViewOSR*> guest_host_views_; std::set<CefRenderWidgetHostViewOSR*> guest_host_views_;
CefRefPtr<CefBrowserHostImpl> browser_impl_; CefRefPtr<AlloyBrowserHostImpl> browser_impl_;
bool is_showing_ = false; bool is_showing_ = false;
bool is_destroyed_ = false; bool is_destroyed_ = false;

View File

@ -7,7 +7,6 @@
#include <windows.h> #include <windows.h>
#include "libcef/browser/browser_host_impl.h"
#include "libcef/common/app_manager.h" #include "libcef/common/app_manager.h"
#include "ui/resources/grit/ui_unscaled_resources.h" #include "ui/resources/grit/ui_unscaled_resources.h"

View File

@ -4,7 +4,6 @@
#include "libcef/browser/osr/video_consumer_osr.h" #include "libcef/browser/osr/video_consumer_osr.h"
#include "libcef/browser/browser_host_impl.h"
#include "libcef/browser/osr/render_widget_host_view_osr.h" #include "libcef/browser/osr/render_widget_host_view_osr.h"
#include "media/base/video_frame_metadata.h" #include "media/base/video_frame_metadata.h"

View File

@ -5,7 +5,7 @@
#include "libcef/browser/osr/web_contents_view_osr.h" #include "libcef/browser/osr/web_contents_view_osr.h"
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/osr/render_widget_host_view_osr.h" #include "libcef/browser/osr/render_widget_host_view_osr.h"
#include "libcef/common/drag_data_impl.h" #include "libcef/common/drag_data_impl.h"
@ -151,7 +151,7 @@ void CefWebContentsViewOSR::StartDragging(
const gfx::Vector2d& image_offset, const gfx::Vector2d& image_offset,
const content::DragEventSourceInfo& event_info, const content::DragEventSourceInfo& event_info,
content::RenderWidgetHostImpl* source_rwh) { content::RenderWidgetHostImpl* source_rwh) {
CefRefPtr<CefBrowserHostImpl> browser = GetBrowser(); CefRefPtr<AlloyBrowserHostImpl> browser = GetBrowser();
if (browser.get()) { if (browser.get()) {
browser->StartDragging(drop_data, allowed_ops, image, image_offset, browser->StartDragging(drop_data, allowed_ops, image, image_offset,
event_info, source_rwh); event_info, source_rwh);
@ -163,7 +163,7 @@ void CefWebContentsViewOSR::StartDragging(
void CefWebContentsViewOSR::UpdateDragCursor( void CefWebContentsViewOSR::UpdateDragCursor(
blink::WebDragOperation operation) { blink::WebDragOperation operation) {
CefRefPtr<CefBrowserHostImpl> browser = GetBrowser(); CefRefPtr<AlloyBrowserHostImpl> browser = GetBrowser();
if (browser.get()) if (browser.get())
browser->UpdateDragCursor(operation); browser->UpdateDragCursor(operation);
} }
@ -176,7 +176,7 @@ CefRenderWidgetHostViewOSR* CefWebContentsViewOSR::GetView() const {
return nullptr; return nullptr;
} }
CefBrowserHostImpl* CefWebContentsViewOSR::GetBrowser() const { AlloyBrowserHostImpl* CefWebContentsViewOSR::GetBrowser() const {
CefRenderWidgetHostViewOSR* view = GetView(); CefRenderWidgetHostViewOSR* view = GetView();
if (view) if (view)
return view->browser_impl().get(); return view->browser_impl().get();

View File

@ -16,7 +16,7 @@ class WebContents;
class WebContentsViewDelegate; class WebContentsViewDelegate;
} // namespace content } // namespace content
class CefBrowserHostImpl; class AlloyBrowserHostImpl;
class CefRenderWidgetHostViewOSR; class CefRenderWidgetHostViewOSR;
// An implementation of WebContentsView for off-screen rendering. // An implementation of WebContentsView for off-screen rendering.
@ -76,7 +76,7 @@ class CefWebContentsViewOSR : public content::WebContentsView,
private: private:
CefRenderWidgetHostViewOSR* GetView() const; CefRenderWidgetHostViewOSR* GetView() const;
CefBrowserHostImpl* GetBrowser() const; AlloyBrowserHostImpl* GetBrowser() const;
const SkColor background_color_; const SkColor background_color_;
const bool use_shared_texture_; const bool use_shared_texture_;

View File

@ -6,7 +6,7 @@
#include <string> #include <string>
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/context.h" #include "libcef/browser/context.h"
#include "libcef/browser/extensions/browser_extensions_util.h" #include "libcef/browser/extensions/browser_extensions_util.h"
#include "libcef/common/cef_switches.h" #include "libcef/common/cef_switches.h"
@ -354,7 +354,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
void PopulateWebPreferences(content::RenderViewHost* rvh, void PopulateWebPreferences(content::RenderViewHost* rvh,
content::WebPreferences& web) { content::WebPreferences& web) {
REQUIRE_ALLOY_RUNTIME(); REQUIRE_ALLOY_RUNTIME();
CefRefPtr<CefBrowserHostImpl> browser = static_cast<CefBrowserHostImpl*>( CefRefPtr<AlloyBrowserHostImpl> browser = static_cast<AlloyBrowserHostImpl*>(
extensions::GetOwnerBrowserForHost(rvh, nullptr).get()); extensions::GetOwnerBrowserForHost(rvh, nullptr).get());
// Set defaults for preferences that are not handled by PrefService. // Set defaults for preferences that are not handled by PrefService.

View File

@ -20,9 +20,9 @@ class CefRequestContextHandlerMap {
~CefRequestContextHandlerMap(); ~CefRequestContextHandlerMap();
// Keep track of handlers associated with specific frames. This information // Keep track of handlers associated with specific frames. This information
// originates from frame create/delete notifications in CefBrowserHostImpl or // originates from frame create/delete notifications in
// CefMimeHandlerViewGuestDelegate which are forwarded via // CefBrowserContentsDelegate or CefMimeHandlerViewGuestDelegate which are
// CefRequestContextImpl and CefBrowserContext. // forwarded via CefRequestContextImpl and CefBrowserContext.
void AddHandler(int render_process_id, void AddHandler(int render_process_id,
int render_frame_id, int render_frame_id,
int frame_tree_node_id, int frame_tree_node_id,

View File

@ -81,7 +81,7 @@ class CefRequestContextImpl : public CefRequestContext {
const CefRequestContextSettings& settings() const { return config_.settings; } const CefRequestContextSettings& settings() const { return config_.settings; }
// Called from CefBrowserHostImpl::RenderFrameCreated or // Called from CefBrowserContentsDelegate::RenderFrameCreated or
// CefMimeHandlerViewGuestDelegate::OnGuestAttached when a render frame is // CefMimeHandlerViewGuestDelegate::OnGuestAttached when a render frame is
// created. // created.
void OnRenderFrameCreated(int render_process_id, void OnRenderFrameCreated(int render_process_id,
@ -90,7 +90,7 @@ class CefRequestContextImpl : public CefRequestContext {
bool is_main_frame, bool is_main_frame,
bool is_guest_view); bool is_guest_view);
// Called from CefBrowserHostImpl::FrameDeleted or // Called from CefBrowserContentsDelegate::RenderFrameDeleted or
// CefMimeHandlerViewGuestDelegate::OnGuestDetached when a render frame is // CefMimeHandlerViewGuestDelegate::OnGuestDetached when a render frame is
// deleted. // deleted.
void OnRenderFrameDeleted(int render_process_id, void OnRenderFrameDeleted(int render_process_id,

View File

@ -7,7 +7,7 @@
#include <utility> #include <utility>
#include "include/views/cef_window.h" #include "include/views/cef_window.h"
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/views/browser_view_impl.h" #include "libcef/browser/views/browser_view_impl.h"
#include "libcef/browser/views/menu_runner_views.h" #include "libcef/browser/views/menu_runner_views.h"
@ -80,7 +80,7 @@ void CefBrowserPlatformDelegateViews::WebContentsDestroyed(
} }
void CefBrowserPlatformDelegateViews::BrowserCreated( void CefBrowserPlatformDelegateViews::BrowserCreated(
CefBrowserHostImpl* browser) { AlloyBrowserHostImpl* browser) {
CefBrowserPlatformDelegateAlloy::BrowserCreated(browser); CefBrowserPlatformDelegateAlloy::BrowserCreated(browser);
native_delegate_->BrowserCreated(browser); native_delegate_->BrowserCreated(browser);
@ -102,7 +102,7 @@ void CefBrowserPlatformDelegateViews::NotifyBrowserDestroyed() {
} }
void CefBrowserPlatformDelegateViews::BrowserDestroyed( void CefBrowserPlatformDelegateViews::BrowserDestroyed(
CefBrowserHostImpl* browser) { AlloyBrowserHostImpl* browser) {
CefBrowserPlatformDelegateAlloy::BrowserDestroyed(browser); CefBrowserPlatformDelegateAlloy::BrowserDestroyed(browser);
browser_view_->BrowserDestroyed(browser); browser_view_->BrowserDestroyed(browser);
@ -161,7 +161,7 @@ void CefBrowserPlatformDelegateViews::PopupWebContentsCreated(
} }
void CefBrowserPlatformDelegateViews::PopupBrowserCreated( void CefBrowserPlatformDelegateViews::PopupBrowserCreated(
CefBrowserHostImpl* new_browser, AlloyBrowserHostImpl* new_browser,
bool is_devtools) { bool is_devtools) {
CefRefPtr<CefBrowserView> new_browser_view = CefRefPtr<CefBrowserView> new_browser_view =
CefBrowserView::GetForBrowser(new_browser); CefBrowserView::GetForBrowser(new_browser);

View File

@ -24,10 +24,10 @@ class CefBrowserPlatformDelegateViews
void WebContentsCreated(content::WebContents* web_contents, void WebContentsCreated(content::WebContents* web_contents,
bool owned) override; bool owned) override;
void WebContentsDestroyed(content::WebContents* web_contents) override; void WebContentsDestroyed(content::WebContents* web_contents) override;
void BrowserCreated(CefBrowserHostImpl* browser) override; void BrowserCreated(AlloyBrowserHostImpl* browser) override;
void NotifyBrowserCreated() override; void NotifyBrowserCreated() override;
void NotifyBrowserDestroyed() override; void NotifyBrowserDestroyed() override;
void BrowserDestroyed(CefBrowserHostImpl* browser) override; void BrowserDestroyed(AlloyBrowserHostImpl* browser) override;
bool CreateHostWindow() override; bool CreateHostWindow() override;
void CloseHostWindow() override; void CloseHostWindow() override;
CefWindowHandle GetHostWindowHandle() const override; CefWindowHandle GetHostWindowHandle() const override;
@ -39,7 +39,7 @@ class CefBrowserPlatformDelegateViews
content::WebContents* new_web_contents, content::WebContents* new_web_contents,
CefBrowserPlatformDelegate* new_platform_delegate, CefBrowserPlatformDelegate* new_platform_delegate,
bool is_devtools) override; bool is_devtools) override;
void PopupBrowserCreated(CefBrowserHostImpl* new_browser, void PopupBrowserCreated(AlloyBrowserHostImpl* new_browser,
bool is_devtools) override; bool is_devtools) override;
SkColor GetBackgroundColor() const override; SkColor GetBackgroundColor() const override;
void WasResized() override; void WasResized() override;

View File

@ -4,7 +4,7 @@
#include "libcef/browser/views/browser_view_impl.h" #include "libcef/browser/views/browser_view_impl.h"
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/browser_util.h" #include "libcef/browser/browser_util.h"
#include "libcef/browser/context.h" #include "libcef/browser/context.h"
#include "libcef/browser/thread_util.h" #include "libcef/browser/thread_util.h"
@ -30,8 +30,8 @@ CefRefPtr<CefBrowserView> CefBrowserView::CreateBrowserView(
CefRefPtr<CefBrowserView> CefBrowserView::GetForBrowser( CefRefPtr<CefBrowserView> CefBrowserView::GetForBrowser(
CefRefPtr<CefBrowser> browser) { CefRefPtr<CefBrowser> browser) {
CEF_REQUIRE_UIT_RETURN(nullptr); CEF_REQUIRE_UIT_RETURN(nullptr);
CefBrowserHostImpl* browser_impl = AlloyBrowserHostImpl* browser_impl =
static_cast<CefBrowserHostImpl*>(browser.get()); static_cast<AlloyBrowserHostImpl*>(browser.get());
if (browser_impl && browser_impl->IsViewsHosted()) if (browser_impl && browser_impl->IsViewsHosted())
return browser_impl->GetBrowserView(); return browser_impl->GetBrowserView();
return nullptr; return nullptr;
@ -75,13 +75,13 @@ void CefBrowserViewImpl::WebContentsCreated(
} }
void CefBrowserViewImpl::BrowserCreated( void CefBrowserViewImpl::BrowserCreated(
CefBrowserHostImpl* browser, AlloyBrowserHostImpl* browser,
base::RepeatingClosure on_bounds_changed) { base::RepeatingClosure on_bounds_changed) {
browser_ = browser; browser_ = browser;
on_bounds_changed_ = on_bounds_changed; on_bounds_changed_ = on_bounds_changed;
} }
void CefBrowserViewImpl::BrowserDestroyed(CefBrowserHostImpl* browser) { void CefBrowserViewImpl::BrowserDestroyed(AlloyBrowserHostImpl* browser) {
DCHECK_EQ(browser, browser_); DCHECK_EQ(browser, browser_);
browser_ = nullptr; browser_ = nullptr;
@ -145,7 +145,7 @@ void CefBrowserViewImpl::Detach() {
if (browser_) { if (browser_) {
// |browser_| will disappear when WindowDestroyed() indirectly calls // |browser_| will disappear when WindowDestroyed() indirectly calls
// BrowserDestroyed() so keep a reference. // BrowserDestroyed() so keep a reference.
CefRefPtr<CefBrowserHostImpl> browser = browser_; CefRefPtr<AlloyBrowserHostImpl> browser = browser_;
// Force the browser to be destroyed. // Force the browser to be destroyed.
browser->WindowDestroyed(); browser->WindowDestroyed();
@ -165,7 +165,7 @@ void CefBrowserViewImpl::OnBrowserViewAdded() {
// hierarchy. // hierarchy.
pending_browser_create_params_->browser_view = this; pending_browser_create_params_->browser_view = this;
CefBrowserHostImpl::Create(*pending_browser_create_params_); AlloyBrowserHostImpl::Create(*pending_browser_create_params_);
DCHECK(browser_); DCHECK(browser_);
pending_browser_create_params_.reset(nullptr); pending_browser_create_params_.reset(nullptr);

View File

@ -10,7 +10,7 @@
#include "include/views/cef_browser_view.h" #include "include/views/cef_browser_view.h"
#include "include/views/cef_browser_view_delegate.h" #include "include/views/cef_browser_view_delegate.h"
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/views/browser_view_view.h" #include "libcef/browser/views/browser_view_view.h"
#include "libcef/browser/views/view_impl.h" #include "libcef/browser/views/view_impl.h"
@ -44,9 +44,9 @@ class CefBrowserViewImpl : public CefViewImpl<CefBrowserViewView,
// Called from CefBrowserPlatformDelegateViews. // Called from CefBrowserPlatformDelegateViews.
void WebContentsCreated(content::WebContents* web_contents); void WebContentsCreated(content::WebContents* web_contents);
void BrowserCreated(CefBrowserHostImpl* browser, void BrowserCreated(AlloyBrowserHostImpl* browser,
base::RepeatingClosure on_bounds_changed); base::RepeatingClosure on_bounds_changed);
void BrowserDestroyed(CefBrowserHostImpl* browser); void BrowserDestroyed(AlloyBrowserHostImpl* browser);
// Called to handle accelerators when the event is unhandled by the web // Called to handle accelerators when the event is unhandled by the web
// content and the browser client. // content and the browser client.
@ -98,7 +98,7 @@ class CefBrowserViewImpl : public CefViewImpl<CefBrowserViewView,
std::unique_ptr<CefBrowserHostBase::CreateParams> std::unique_ptr<CefBrowserHostBase::CreateParams>
pending_browser_create_params_; pending_browser_create_params_;
CefRefPtr<CefBrowserHostImpl> browser_; CefRefPtr<AlloyBrowserHostImpl> browser_;
views::UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; views::UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_;
bool ignore_next_char_event_ = false; bool ignore_next_char_event_ = false;

View File

@ -4,14 +4,14 @@
#include "libcef/browser/views/menu_runner_views.h" #include "libcef/browser/views/menu_runner_views.h"
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/views/browser_view_impl.h" #include "libcef/browser/views/browser_view_impl.h"
CefMenuRunnerViews::CefMenuRunnerViews(CefBrowserViewImpl* browser_view) CefMenuRunnerViews::CefMenuRunnerViews(CefBrowserViewImpl* browser_view)
: browser_view_(browser_view) {} : browser_view_(browser_view) {}
bool CefMenuRunnerViews::RunContextMenu( bool CefMenuRunnerViews::RunContextMenu(
CefBrowserHostImpl* browser, AlloyBrowserHostImpl* browser,
CefMenuModelImpl* model, CefMenuModelImpl* model,
const content::ContextMenuParams& params) { const content::ContextMenuParams& params) {
CefRefPtr<CefWindow> window = browser_view_->GetWindow(); CefRefPtr<CefWindow> window = browser_view_->GetWindow();

View File

@ -16,7 +16,7 @@ class CefMenuRunnerViews : public CefMenuRunner {
explicit CefMenuRunnerViews(CefBrowserViewImpl* browser_view); explicit CefMenuRunnerViews(CefBrowserViewImpl* browser_view);
// CefMenuRunner methods. // CefMenuRunner methods.
bool RunContextMenu(CefBrowserHostImpl* browser, bool RunContextMenu(AlloyBrowserHostImpl* browser,
CefMenuModelImpl* model, CefMenuModelImpl* model,
const content::ContextMenuParams& params) override; const content::ContextMenuParams& params) override;
void CancelContextMenu() override; void CancelContextMenu() override;

View File

@ -114,7 +114,7 @@ class CefRequestImpl : public CefRequest {
blink::WebURLRequest& request); blink::WebURLRequest& request);
// Populate the CefNavigateParams object from this object. // Populate the CefNavigateParams object from this object.
// Called from CefBrowserHostImpl::LoadRequest(). // Called from CefFrameHostImpl::LoadRequest().
void Get(CefNavigateParams& params) const; void Get(CefNavigateParams& params) const;
void SetReadOnly(bool read_only); void SetReadOnly(bool read_only);

View File

@ -47,7 +47,7 @@ index c7bd97a32af1..311f2c52af8d 100644
"views/toolbar/toolbar_account_icon_container_view.h", "views/toolbar/toolbar_account_icon_container_view.h",
"views/toolbar/toolbar_action_view.cc", "views/toolbar/toolbar_action_view.cc",
diff --git chrome/browser/ui/webui/net_export_ui.cc chrome/browser/ui/webui/net_export_ui.cc diff --git chrome/browser/ui/webui/net_export_ui.cc chrome/browser/ui/webui/net_export_ui.cc
index f27414c41891..0e6663680e80 100644 index f27414c41891..5ff3bfa8f724 100644
--- chrome/browser/ui/webui/net_export_ui.cc --- chrome/browser/ui/webui/net_export_ui.cc
+++ chrome/browser/ui/webui/net_export_ui.cc +++ chrome/browser/ui/webui/net_export_ui.cc
@@ -21,6 +21,7 @@ @@ -21,6 +21,7 @@
@ -63,7 +63,7 @@ index f27414c41891..0e6663680e80 100644
#include "ui/shell_dialogs/select_file_dialog.h" #include "ui/shell_dialogs/select_file_dialog.h"
+#if BUILDFLAG(ENABLE_CEF) +#if BUILDFLAG(ENABLE_CEF)
+#include "cef/libcef/browser/browser_host_impl.h" +#include "cef/libcef/browser/alloy/alloy_browser_host_impl.h"
+#endif +#endif
+ +
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
@ -121,8 +121,8 @@ index f27414c41891..0e6663680e80 100644
+ +
+void NetExportMessageHandler::ShowCefSaveAsDialog( +void NetExportMessageHandler::ShowCefSaveAsDialog(
+ content::WebContents* web_contents) { + content::WebContents* web_contents) {
+ CefRefPtr<CefBrowserHostImpl> cef_browser = + CefRefPtr<AlloyBrowserHostImpl> cef_browser =
+ CefBrowserHostImpl::GetBrowserForContents(web_contents); + AlloyBrowserHostImpl::GetBrowserForContents(web_contents);
+ if (!cef_browser) + if (!cef_browser)
+ return; + return;
+ +

View File

@ -112,80 +112,77 @@ index b59728f623e3..6fd443962836 100644
ConstrainedWebDialogUI::~ConstrainedWebDialogUI() { ConstrainedWebDialogUI::~ConstrainedWebDialogUI() {
diff --git chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc diff --git chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc
index bb362bbd321e..ba5a9336ec6a 100644 index bb362bbd321e..24e94cfd4211 100644
--- chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc --- chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc
+++ chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc +++ chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc
@@ -184,8 +184,10 @@ PdfPrinterHandler::PdfPrinterHandler( @@ -20,6 +20,7 @@
sticky_settings_(sticky_settings) {} #include "base/task/thread_pool.h"
#include "base/values.h"
#include "build/build_config.h"
+#include "cef/libcef/features/runtime.h"
#include "chrome/browser/app_mode/app_mode_utils.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/download/download_prefs.h"
@@ -54,6 +55,10 @@
#include "chrome/browser/chromeos/drive/drive_integration_service.h"
#endif
PdfPrinterHandler::~PdfPrinterHandler() { +#if BUILDFLAG(ENABLE_CEF)
+#if !BUILDFLAG(ENABLE_CEF) +#include "cef/libcef/browser/alloy/alloy_browser_host_impl.h"
if (select_file_dialog_.get())
select_file_dialog_->ListenerDestroyed();
+#endif +#endif
} +
namespace printing {
void PdfPrinterHandler::Reset() { namespace {
@@ -232,12 +234,14 @@ void PdfPrinterHandler::StartPrint( @@ -380,10 +385,27 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename,
return;
}
+#if !BUILDFLAG(ENABLE_CEF)
if (select_file_dialog_ &&
select_file_dialog_->IsRunning(
platform_util::GetTopLevel(preview_web_contents_->GetNativeView()))) {
// Dialog is already showing.
return;
}
+#endif
DCHECK(!print_callback_);
print_callback_ = std::move(callback);
@@ -380,7 +384,11 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename,
// If the directory is empty there is no reason to create it or use the // If the directory is empty there is no reason to create it or use the
// default location. // default location.
if (path.empty()) { if (path.empty()) {
+#if !BUILDFLAG(ENABLE_CEF) +#if BUILDFLAG(ENABLE_CEF)
OnDirectorySelected(default_filename, path); + if (cef::IsAlloyRuntimeEnabled()) {
+#else + ShowCefSaveAsDialog(initiator, default_filename, path);
+ ShowCefSaveAsDialog(initiator, default_filename, path); + return;
+ }
+#endif +#endif
OnDirectorySelected(default_filename, path);
return; return;
} }
@@ -391,8 +399,14 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename, + auto callback = base::BindOnce(&PdfPrinterHandler::OnDirectorySelected,
+ weak_ptr_factory_.GetWeakPtr(),
+ default_filename);
+#if BUILDFLAG(ENABLE_CEF)
+ if (cef::IsAlloyRuntimeEnabled()) {
+ callback = base::BindOnce(&PdfPrinterHandler::ShowCefSaveAsDialog,
+ weak_ptr_factory_.GetWeakPtr(), initiator,
+ default_filename);
+ }
+#endif
+
// Get default download directory. This will be used as a fallback if the
// save directory does not exist.
DownloadPrefs* download_prefs = DownloadPrefs::FromBrowserContext(profile_);
@@ -391,8 +413,7 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename,
base::ThreadPool::PostTaskAndReplyWithResult( base::ThreadPool::PostTaskAndReplyWithResult(
FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT}, FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT},
base::BindOnce(&SelectSaveDirectory, path, default_path), base::BindOnce(&SelectSaveDirectory, path, default_path),
+#if !BUILDFLAG(ENABLE_CEF) - base::BindOnce(&PdfPrinterHandler::OnDirectorySelected,
base::BindOnce(&PdfPrinterHandler::OnDirectorySelected, - weak_ptr_factory_.GetWeakPtr(), default_filename));
weak_ptr_factory_.GetWeakPtr(), default_filename)); + std::move(callback));
+#else
+ base::BindOnce(&PdfPrinterHandler::ShowCefSaveAsDialog,
+ weak_ptr_factory_.GetWeakPtr(), initiator,
+ default_filename));
+#endif
} }
void PdfPrinterHandler::PostPrintToPdfTask() { void PdfPrinterHandler::PostPrintToPdfTask() {
@@ -408,6 +422,7 @@ void PdfPrinterHandler::OnGotUniqueFileName(const base::FilePath& path) { @@ -433,6 +454,40 @@ void PdfPrinterHandler::OnDirectorySelected(const base::FilePath& filename,
FileSelected(path, 0, nullptr);
}
+#if !BUILDFLAG(ENABLE_CEF)
void PdfPrinterHandler::OnDirectorySelected(const base::FilePath& filename,
const base::FilePath& directory) {
base::FilePath path = directory.Append(filename);
@@ -432,6 +447,37 @@ void PdfPrinterHandler::OnDirectorySelected(const base::FilePath& filename,
&file_type_info, 0, base::FilePath::StringType(),
platform_util::GetTopLevel(preview_web_contents_->GetNativeView()), NULL); platform_util::GetTopLevel(preview_web_contents_->GetNativeView()), NULL);
} }
+#else
+#if BUILDFLAG(ENABLE_CEF)
+
+void PdfPrinterHandler::ShowCefSaveAsDialog(content::WebContents* initiator, +void PdfPrinterHandler::ShowCefSaveAsDialog(content::WebContents* initiator,
+ const base::FilePath& filename, + const base::FilePath& filename,
+ const base::FilePath& directory) { + const base::FilePath& directory) {
+ CefRefPtr<CefBrowserHostImpl> cef_browser = + CefRefPtr<AlloyBrowserHostImpl> cef_browser =
+ CefBrowserHostImpl::GetBrowserForContents(initiator); + AlloyBrowserHostImpl::GetBrowserForContents(initiator);
+ if (!cef_browser) + if (!cef_browser)
+ return; + return;
+ +
@ -210,15 +207,17 @@ index bb362bbd321e..ba5a9336ec6a 100644
+ FileSelectionCanceled(nullptr); + FileSelectionCanceled(nullptr);
+ } + }
+} +}
+#endif +
+#endif // BUILDFLAG(ENABLE_CEF)
+
base::FilePath PdfPrinterHandler::GetSaveLocation() const { base::FilePath PdfPrinterHandler::GetSaveLocation() const {
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
drive::DriveIntegrationService* drive_service =
diff --git chrome/browser/ui/webui/print_preview/pdf_printer_handler.h chrome/browser/ui/webui/print_preview/pdf_printer_handler.h diff --git chrome/browser/ui/webui/print_preview/pdf_printer_handler.h chrome/browser/ui/webui/print_preview/pdf_printer_handler.h
index 26954aeae08f..025ecfa9aceb 100644 index 26954aeae08f..48afeb608f83 100644
--- chrome/browser/ui/webui/print_preview/pdf_printer_handler.h --- chrome/browser/ui/webui/print_preview/pdf_printer_handler.h
+++ chrome/browser/ui/webui/print_preview/pdf_printer_handler.h +++ chrome/browser/ui/webui/print_preview/pdf_printer_handler.h
@@ -11,9 +11,14 @@ @@ -11,6 +11,7 @@
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/strings/string16.h" #include "base/strings/string16.h"
@ -226,32 +225,11 @@ index 26954aeae08f..025ecfa9aceb 100644
#include "chrome/browser/ui/webui/print_preview/printer_handler.h" #include "chrome/browser/ui/webui/print_preview/printer_handler.h"
#include "ui/shell_dialogs/select_file_dialog.h" #include "ui/shell_dialogs/select_file_dialog.h"
+#if BUILDFLAG(ENABLE_CEF) @@ -88,6 +89,15 @@ class PdfPrinterHandler : public PrinterHandler,
+#include "cef/libcef/browser/browser_host_impl.h"
+#endif
+
namespace base {
class FilePath;
class RefCountedMemory;
@@ -76,17 +81,28 @@ class PdfPrinterHandler : public PrinterHandler,
// The print preview web contents. Protected so unit tests can access it.
content::WebContents* const preview_web_contents_;
+#if !BUILDFLAG(ENABLE_CEF)
// The underlying dialog object. Protected so unit tests can access it.
scoped_refptr<ui::SelectFileDialog> select_file_dialog_;
+#endif
private:
void PostPrintToPdfTask();
void OnGotUniqueFileName(const base::FilePath& path);
+#if !BUILDFLAG(ENABLE_CEF)
// Prompts the user to save the file. The dialog will default to saving
// the file with name |filename| in |directory|.
void OnDirectorySelected(const base::FilePath& filename, void OnDirectorySelected(const base::FilePath& filename,
const base::FilePath& directory); const base::FilePath& directory);
+#else
+#if BUILDFLAG(ENABLE_CEF)
+ void ShowCefSaveAsDialog(content::WebContents* initiator, + void ShowCefSaveAsDialog(content::WebContents* initiator,
+ const base::FilePath& filename, + const base::FilePath& filename,
+ const base::FilePath& directory); + const base::FilePath& directory);
@ -259,9 +237,10 @@ index 26954aeae08f..025ecfa9aceb 100644
+ void SaveAsDialogDismissed(int selected_accept_filter, + void SaveAsDialogDismissed(int selected_accept_filter,
+ const std::vector<base::FilePath>& file_paths); + const std::vector<base::FilePath>& file_paths);
+#endif +#endif
+
// Return save location as the Drive mount or fetch from Download Preferences. // Return save location as the Drive mount or fetch from Download Preferences.
base::FilePath GetSaveLocation() const; base::FilePath GetSaveLocation() const;
diff --git chrome/browser/ui/webui/print_preview/print_preview_handler.cc chrome/browser/ui/webui/print_preview/print_preview_handler.cc diff --git chrome/browser/ui/webui/print_preview/print_preview_handler.cc chrome/browser/ui/webui/print_preview/print_preview_handler.cc
index ba451b6c854d..0f062e69fd47 100644 index ba451b6c854d..0f062e69fd47 100644
--- chrome/browser/ui/webui/print_preview/print_preview_handler.cc --- chrome/browser/ui/webui/print_preview/print_preview_handler.cc