mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Rename CefBrowserHostImpl to AlloyBrowserHostImpl (see issue #2969)
After commit 38d8acfa18
this object is only used with the alloy runtime.
This commit is contained in:
4
BUILD.gn
4
BUILD.gn
@@ -409,6 +409,8 @@ static_library("libcef_static") {
|
||||
gypi_paths.autogen_cpp_includes + [
|
||||
"libcef/browser/alloy/alloy_browser_context.cc",
|
||||
"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.h",
|
||||
"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.h",
|
||||
"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.h",
|
||||
"libcef/browser/browser_info_manager.cc",
|
||||
|
@@ -115,8 +115,8 @@ class AlloyBrowserContext : public ChromeProfileAlloy,
|
||||
return extension_system_;
|
||||
}
|
||||
|
||||
// Called from CefBrowserHostImpl::DidFinishNavigation to update the table of
|
||||
// visited links.
|
||||
// Called from AlloyBrowserHostImpl::DidFinishNavigation to update the table
|
||||
// of visited links.
|
||||
void AddVisitedURLs(const std::vector<GURL>& urls);
|
||||
|
||||
// Called from DownloadPrefs::FromBrowserContext.
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -3,8 +3,8 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef CEF_LIBCEF_BROWSER_BROWSER_HOST_IMPL_H_
|
||||
#define CEF_LIBCEF_BROWSER_BROWSER_HOST_IMPL_H_
|
||||
#ifndef CEF_LIBCEF_BROWSER_ALLOY_ALLOY_BROWSER_HOST_IMPL_H_
|
||||
#define CEF_LIBCEF_BROWSER_ALLOY_ALLOY_BROWSER_HOST_IMPL_H_
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
@@ -62,19 +62,19 @@ class SiteInstance;
|
||||
// thread-safe unless otherwise indicated.
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// WebContentsObserver: Interface for observing WebContents notifications and
|
||||
// IPC messages. There is a one-to-one relationship between WebContents and
|
||||
// RenderViewHost instances. IPC messages received by the RenderViewHost will be
|
||||
// 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
|
||||
// WebContentsObserver::routing_id() when sending IPC messages.
|
||||
//
|
||||
// NotificationObserver: Interface for observing post-processed notifications.
|
||||
class CefBrowserHostImpl : public CefBrowserHostBase,
|
||||
class AlloyBrowserHostImpl : public CefBrowserHostBase,
|
||||
public content::WebContentsDelegate,
|
||||
public content::WebContentsObserver,
|
||||
public content::NotificationObserver {
|
||||
@@ -85,25 +85,25 @@ class CefBrowserHostImpl : public CefBrowserHostBase,
|
||||
virtual void OnResponse(const std::string& response) = 0;
|
||||
};
|
||||
|
||||
~CefBrowserHostImpl() override;
|
||||
~AlloyBrowserHostImpl() override;
|
||||
|
||||
// Create a new CefBrowserHostImpl instance with owned WebContents.
|
||||
static CefRefPtr<CefBrowserHostImpl> Create(CreateParams& create_params);
|
||||
// Create a new AlloyBrowserHostImpl instance with owned WebContents.
|
||||
static CefRefPtr<AlloyBrowserHostImpl> Create(CreateParams& create_params);
|
||||
|
||||
// Returns the browser associated with the specified RenderViewHost.
|
||||
static CefRefPtr<CefBrowserHostImpl> GetBrowserForHost(
|
||||
static CefRefPtr<AlloyBrowserHostImpl> GetBrowserForHost(
|
||||
const content::RenderViewHost* host);
|
||||
// Returns the browser associated with the specified RenderFrameHost.
|
||||
static CefRefPtr<CefBrowserHostImpl> GetBrowserForHost(
|
||||
static CefRefPtr<AlloyBrowserHostImpl> GetBrowserForHost(
|
||||
const content::RenderFrameHost* host);
|
||||
// Returns the browser associated with the specified WebContents.
|
||||
static CefRefPtr<CefBrowserHostImpl> GetBrowserForContents(
|
||||
static CefRefPtr<AlloyBrowserHostImpl> GetBrowserForContents(
|
||||
const content::WebContents* contents);
|
||||
// Returns the browser associated with the specified FrameTreeNode ID.
|
||||
static CefRefPtr<CefBrowserHostImpl> GetBrowserForFrameTreeNode(
|
||||
static CefRefPtr<AlloyBrowserHostImpl> GetBrowserForFrameTreeNode(
|
||||
int frame_tree_node_id);
|
||||
// Returns the browser associated with the specified frame routing IDs.
|
||||
static CefRefPtr<CefBrowserHostImpl> GetBrowserForFrameRoute(
|
||||
static CefRefPtr<AlloyBrowserHostImpl> GetBrowserForFrameRoute(
|
||||
int render_process_id,
|
||||
int render_routing_id);
|
||||
|
||||
@@ -379,13 +379,13 @@ class CefBrowserHostImpl : public CefBrowserHostBase,
|
||||
private:
|
||||
friend class CefBrowserPlatformDelegateAlloy;
|
||||
|
||||
static CefRefPtr<CefBrowserHostImpl> CreateInternal(
|
||||
static CefRefPtr<AlloyBrowserHostImpl> CreateInternal(
|
||||
const CefBrowserSettings& settings,
|
||||
CefRefPtr<CefClient> client,
|
||||
content::WebContents* web_contents,
|
||||
bool own_web_contents,
|
||||
scoped_refptr<CefBrowserInfo> browser_info,
|
||||
CefRefPtr<CefBrowserHostImpl> opener,
|
||||
CefRefPtr<AlloyBrowserHostImpl> opener,
|
||||
bool is_devtools_popup,
|
||||
CefRefPtr<CefRequestContextImpl> request_context,
|
||||
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate,
|
||||
@@ -396,12 +396,12 @@ class CefBrowserHostImpl : public CefBrowserHostBase,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) override;
|
||||
|
||||
CefBrowserHostImpl(
|
||||
AlloyBrowserHostImpl(
|
||||
const CefBrowserSettings& settings,
|
||||
CefRefPtr<CefClient> client,
|
||||
content::WebContents* web_contents,
|
||||
scoped_refptr<CefBrowserInfo> browser_info,
|
||||
CefRefPtr<CefBrowserHostImpl> opener,
|
||||
CefRefPtr<AlloyBrowserHostImpl> opener,
|
||||
CefRefPtr<CefRequestContextImpl> request_context,
|
||||
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate,
|
||||
CefRefPtr<CefExtension> extension);
|
||||
@@ -470,4 +470,4 @@ class CefBrowserHostImpl : public CefBrowserHostBase,
|
||||
base::OneShotTimer recently_audible_timer_;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_BROWSER_HOST_IMPL_H_
|
||||
#endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_BROWSER_HOST_IMPL_H_
|
@@ -9,9 +9,9 @@
|
||||
|
||||
#include "include/cef_version.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/browser_context.h"
|
||||
#include "libcef/browser/browser_host_impl.h"
|
||||
#include "libcef/browser/browser_info.h"
|
||||
#include "libcef/browser/browser_info_manager.h"
|
||||
#include "libcef/browser/browser_message_filter.h"
|
||||
@@ -349,8 +349,8 @@ class CefQuotaPermissionContext : public content::QuotaPermissionContext {
|
||||
|
||||
bool handled = false;
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl> browser =
|
||||
CefBrowserHostImpl::GetBrowserForFrameRoute(render_process_id,
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser =
|
||||
AlloyBrowserHostImpl::GetBrowserForFrameRoute(render_process_id,
|
||||
params.render_frame_id);
|
||||
if (browser.get()) {
|
||||
CefRefPtr<CefClient> client = browser->GetClient();
|
||||
@@ -459,7 +459,7 @@ bool NavigationOnUIThread(
|
||||
open_params.user_gesture = params.has_user_gesture();
|
||||
open_params.initiator_origin = params.initiator_origin();
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl> browser;
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser;
|
||||
if (!CefBrowserInfoManager::GetInstance()->MaybeAllowNavigation(
|
||||
source->GetMainFrame(), open_params, browser)) {
|
||||
// Cancel the navigation.
|
||||
@@ -939,8 +939,8 @@ void AlloyContentBrowserClient::AllowCertificateError(
|
||||
return;
|
||||
}
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl> browser =
|
||||
CefBrowserHostImpl::GetBrowserForContents(web_contents);
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser =
|
||||
AlloyBrowserHostImpl::GetBrowserForContents(web_contents);
|
||||
if (!browser.get())
|
||||
return;
|
||||
CefRefPtr<CefClient> client = browser->GetClient();
|
||||
@@ -975,8 +975,8 @@ base::OnceClosure AlloyContentBrowserClient::SelectClientCertificate(
|
||||
CEF_REQUIRE_UIT();
|
||||
|
||||
CefRefPtr<CefRequestHandler> handler;
|
||||
CefRefPtr<CefBrowserHostImpl> browser =
|
||||
CefBrowserHostImpl::GetBrowserForContents(web_contents);
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser =
|
||||
AlloyBrowserHostImpl::GetBrowserForContents(web_contents);
|
||||
if (browser.get()) {
|
||||
CefRefPtr<CefClient> client = browser->GetClient();
|
||||
if (client.get())
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
#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/extension_background_host.h"
|
||||
#include "libcef/browser/extensions/extension_system.h"
|
||||
@@ -105,8 +105,8 @@ void CefBrowserPlatformDelegateAlloy::AddNewContents(
|
||||
const gfx::Rect& initial_rect,
|
||||
bool user_gesture,
|
||||
bool* was_blocked) {
|
||||
CefRefPtr<CefBrowserHostImpl> owner =
|
||||
CefBrowserHostImpl::GetBrowserForContents(new_contents.get());
|
||||
CefRefPtr<AlloyBrowserHostImpl> owner =
|
||||
AlloyBrowserHostImpl::GetBrowserForContents(new_contents.get());
|
||||
if (owner) {
|
||||
// Taking ownership of |new_contents|.
|
||||
static_cast<CefBrowserPlatformDelegateAlloy*>(
|
||||
@@ -143,7 +143,7 @@ void CefBrowserPlatformDelegateAlloy::RenderViewReady() {
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateAlloy::BrowserCreated(
|
||||
CefBrowserHostImpl* browser) {
|
||||
AlloyBrowserHostImpl* browser) {
|
||||
CefBrowserPlatformDelegate::BrowserCreated(browser);
|
||||
|
||||
web_contents_->SetDelegate(browser);
|
||||
@@ -202,7 +202,7 @@ extensions::ExtensionHost* CefBrowserPlatformDelegateAlloy::GetExtensionHost()
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateAlloy::BrowserDestroyed(
|
||||
CefBrowserHostImpl* browser) {
|
||||
AlloyBrowserHostImpl* browser) {
|
||||
DestroyExtensionHost();
|
||||
owned_web_contents_.reset();
|
||||
|
||||
|
@@ -29,12 +29,12 @@ class CefBrowserPlatformDelegateAlloy : public CefBrowserPlatformDelegate {
|
||||
bool ShouldTransferNavigation(bool is_main_frame_navigation) override;
|
||||
void RenderViewCreated(content::RenderViewHost* render_view_host) override;
|
||||
void RenderViewReady() override;
|
||||
void BrowserCreated(CefBrowserHostImpl* browser) override;
|
||||
void BrowserCreated(AlloyBrowserHostImpl* browser) override;
|
||||
void CreateExtensionHost(const extensions::Extension* extension,
|
||||
const GURL& url,
|
||||
extensions::ViewType host_type) override;
|
||||
extensions::ExtensionHost* GetExtensionHost() const override;
|
||||
void BrowserDestroyed(CefBrowserHostImpl* browser) override;
|
||||
void BrowserDestroyed(AlloyBrowserHostImpl* browser) override;
|
||||
void SendCaptureLostEvent() override;
|
||||
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MAC))
|
||||
void NotifyMoveOrResizeStarted() override;
|
||||
|
@@ -4,7 +4,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#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 "content/public/browser/audio_loopback_stream_creator.h"
|
||||
@@ -51,7 +51,7 @@ void StreamCreatorHelper(
|
||||
} // namespace
|
||||
|
||||
CefAudioCapturer::CefAudioCapturer(const CefAudioParameters& params,
|
||||
CefRefPtr<CefBrowserHostImpl> browser,
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser,
|
||||
CefRefPtr<CefAudioHandler> audio_handler)
|
||||
: params_(params),
|
||||
browser_(browser),
|
||||
|
@@ -21,12 +21,12 @@ class AudioInputDevice;
|
||||
} // namespace media
|
||||
|
||||
class CefAudioHandler;
|
||||
class CefBrowserHostImpl;
|
||||
class AlloyBrowserHostImpl;
|
||||
|
||||
class CefAudioCapturer : public media::AudioCapturerSource::CaptureCallback {
|
||||
public:
|
||||
CefAudioCapturer(const CefAudioParameters& params,
|
||||
CefRefPtr<CefBrowserHostImpl> browser,
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser,
|
||||
CefRefPtr<CefAudioHandler> audio_handler);
|
||||
~CefAudioCapturer() override;
|
||||
|
||||
@@ -42,7 +42,7 @@ class CefAudioCapturer : public media::AudioCapturerSource::CaptureCallback {
|
||||
void StopStream();
|
||||
|
||||
CefAudioParameters params_;
|
||||
CefRefPtr<CefBrowserHostImpl> browser_;
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser_;
|
||||
CefRefPtr<CefAudioHandler> audio_handler_;
|
||||
std::unique_ptr<content::AudioLoopbackStreamCreator> audio_stream_creator_;
|
||||
scoped_refptr<media::AudioInputDevice> audio_input_device_;
|
||||
|
@@ -27,7 +27,7 @@
|
||||
// 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.
|
||||
//
|
||||
// BHI = CefBrowserHostImpl
|
||||
// BHI = AlloyBrowserHostImpl
|
||||
// Implements the CefBrowser and CefBrowserHost interfaces which are exposed
|
||||
// to clients. References an RCI instance. Owns a WC. Lifespan is controlled
|
||||
// by client references and CefBrowserInfoManager (until the browser has
|
||||
@@ -62,9 +62,9 @@
|
||||
//
|
||||
//
|
||||
// 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.
|
||||
// 1. CefBrowserHostImpl is destroyed on any thread when the last reference
|
||||
// 1. AlloyBrowserHostImpl is destroyed on any thread when the last reference
|
||||
// is released.
|
||||
// 2. CefRequestContextImpl is destroyed (possibly asynchronously) on the UI
|
||||
// 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
|
||||
// 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.
|
||||
class CefBrowserContext {
|
||||
public:
|
||||
|
@@ -558,9 +558,7 @@ void CefBrowserHostBase::LoadMainFrameURL(const std::string& url,
|
||||
}
|
||||
|
||||
if (!gurl.is_valid()) {
|
||||
LOG(ERROR)
|
||||
<< "Invalid URL passed to CefBrowserHostImpl::LoadMainFrameURL: "
|
||||
<< url;
|
||||
LOG(ERROR) << "Invalid URL: " << url;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#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/context.h"
|
||||
#include "libcef/browser/thread_util.h"
|
||||
@@ -139,6 +139,6 @@ CefRefPtr<CefBrowser> CefBrowserHost::CreateBrowserSync(
|
||||
return browser.get();
|
||||
}
|
||||
|
||||
auto browser = CefBrowserHostImpl::Create(create_params);
|
||||
auto browser = AlloyBrowserHostImpl::Create(create_params);
|
||||
return browser.get();
|
||||
}
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
#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/common/values_impl.h"
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
|
||||
#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/extensions/browser_extensions_util.h"
|
||||
#include "libcef/browser/thread_util.h"
|
||||
@@ -124,7 +124,7 @@ bool CefBrowserInfoManager::CanCreateWindow(
|
||||
/*is_renderer_initiated=*/true);
|
||||
params.user_gesture = user_gesture;
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl> browser;
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser;
|
||||
if (!MaybeAllowNavigation(opener, params, browser) || !browser) {
|
||||
// Cancel the popup.
|
||||
return false;
|
||||
@@ -365,12 +365,12 @@ CefBrowserInfoManager::GetBrowserInfoForFrameRoute(int render_process_id,
|
||||
bool CefBrowserInfoManager::MaybeAllowNavigation(
|
||||
content::RenderFrameHost* opener,
|
||||
const content::OpenURLParams& params,
|
||||
CefRefPtr<CefBrowserHostImpl>& browser_out) const {
|
||||
CefRefPtr<AlloyBrowserHostImpl>& browser_out) const {
|
||||
CEF_REQUIRE_UIT();
|
||||
REQUIRE_ALLOY_RUNTIME();
|
||||
|
||||
bool is_guest_view = false;
|
||||
CefRefPtr<CefBrowserHostImpl> browser = static_cast<CefBrowserHostImpl*>(
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser = static_cast<AlloyBrowserHostImpl*>(
|
||||
extensions::GetOwnerBrowserForHost(opener, &is_guest_view).get());
|
||||
if (!browser) {
|
||||
// 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.
|
||||
CEF_POST_TASK(
|
||||
CEF_UIT,
|
||||
base::Bind(base::IgnoreResult(&CefBrowserHostImpl::OpenURLFromTab),
|
||||
base::Bind(base::IgnoreResult(&AlloyBrowserHostImpl::OpenURLFromTab),
|
||||
browser.get(), nullptr, params));
|
||||
|
||||
return false;
|
||||
|
@@ -38,7 +38,7 @@ class Message;
|
||||
}
|
||||
|
||||
class CefBrowserHostBase;
|
||||
class CefBrowserHostImpl;
|
||||
class AlloyBrowserHostImpl;
|
||||
class CefBrowserPlatformDelegate;
|
||||
|
||||
// Singleton object for managing BrowserInfo instances.
|
||||
@@ -50,7 +50,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
|
||||
// Returns this singleton instance of this class.
|
||||
static CefBrowserInfoManager* GetInstance();
|
||||
|
||||
// Called from CefBrowserHostImpl::Create or
|
||||
// Called from AlloyBrowserHostImpl::Create or
|
||||
// ChromeBrowserDelegate::SetAsDelegate when a new browser is being created
|
||||
// directly. In this case |is_popup| will be true only for DevTools browsers.
|
||||
scoped_refptr<CefBrowserInfo> CreateBrowserInfo(
|
||||
@@ -58,7 +58,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
|
||||
bool is_windowless,
|
||||
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
|
||||
// link). If any OnGetNewBrowserInfo requests are pending for the popup the
|
||||
// response will be sent when this method is called.
|
||||
@@ -79,7 +79,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
|
||||
bool opener_suppressed,
|
||||
bool* no_javascript_access);
|
||||
|
||||
// Called from CefBrowserHostImpl::GetCustomWebContentsView. See comments on
|
||||
// Called from AlloyBrowserHostImpl::GetCustomWebContentsView. See comments on
|
||||
// PendingPopup for more information.
|
||||
void GetCustomWebContentsView(
|
||||
const GURL& target_url,
|
||||
@@ -88,7 +88,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
|
||||
content::WebContentsView** view,
|
||||
content::RenderViewHostDelegateView** delegate_view);
|
||||
|
||||
// Called from CefBrowserHostImpl::WebContentsCreated. See comments on
|
||||
// Called from AlloyBrowserHostImpl::WebContentsCreated. See comments on
|
||||
// PendingPopup for more information.
|
||||
void WebContentsCreated(
|
||||
const GURL& target_url,
|
||||
@@ -147,7 +147,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
|
||||
// |browser| will be set to the target browser if any.
|
||||
bool MaybeAllowNavigation(content::RenderFrameHost* opener,
|
||||
const content::OpenURLParams& params,
|
||||
CefRefPtr<CefBrowserHostImpl>& browser) const;
|
||||
CefRefPtr<AlloyBrowserHostImpl>& browser) const;
|
||||
|
||||
private:
|
||||
// RenderProcessHostObserver methods:
|
||||
@@ -158,12 +158,12 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
|
||||
// Provides an opportunity to cancel the popup (calls OnBeforePopup) and
|
||||
// creates the new platform delegate for the popup. If the popup owner is
|
||||
// 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:
|
||||
// - CefBrowserHostImpl::GetCustomWebContentsView (UIT)
|
||||
// - AlloyBrowserHostImpl::GetCustomWebContentsView (UIT)
|
||||
// Creates the OSR views for windowless popups.
|
||||
// - CefBrowserHostImpl::WebContentsCreated (UIT)
|
||||
// Creates the CefBrowserHostImpl representation for the popup.
|
||||
// - AlloyBrowserHostImpl::WebContentsCreated (UIT)
|
||||
// Creates the AlloyBrowserHostImpl representation for the popup.
|
||||
// - CefBrowserMessageFilter::OnGetNewBrowserInfo (IOT)
|
||||
// Passes information about the popup to the renderer process.
|
||||
struct PendingPopup {
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
#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"
|
||||
|
||||
@@ -57,7 +57,7 @@ void CefBrowserPlatformDelegate::RenderViewCreated(
|
||||
|
||||
void CefBrowserPlatformDelegate::RenderViewReady() {}
|
||||
|
||||
void CefBrowserPlatformDelegate::BrowserCreated(CefBrowserHostImpl* browser) {
|
||||
void CefBrowserPlatformDelegate::BrowserCreated(AlloyBrowserHostImpl* browser) {
|
||||
// We should have an associated WebContents at this point.
|
||||
DCHECK(web_contents_);
|
||||
|
||||
@@ -83,7 +83,8 @@ void CefBrowserPlatformDelegate::NotifyBrowserCreated() {}
|
||||
|
||||
void CefBrowserPlatformDelegate::NotifyBrowserDestroyed() {}
|
||||
|
||||
void CefBrowserPlatformDelegate::BrowserDestroyed(CefBrowserHostImpl* browser) {
|
||||
void CefBrowserPlatformDelegate::BrowserDestroyed(
|
||||
AlloyBrowserHostImpl* browser) {
|
||||
// WebContentsDestroyed should already be called.
|
||||
DCHECK(!web_contents_);
|
||||
|
||||
@@ -120,7 +121,7 @@ void CefBrowserPlatformDelegate::PopupWebContentsCreated(
|
||||
bool is_devtools) {}
|
||||
|
||||
void CefBrowserPlatformDelegate::PopupBrowserCreated(
|
||||
CefBrowserHostImpl* new_browser,
|
||||
AlloyBrowserHostImpl* new_browser,
|
||||
bool is_devtools) {}
|
||||
|
||||
void CefBrowserPlatformDelegate::SendCaptureLostEvent() {
|
||||
|
@@ -13,7 +13,7 @@
|
||||
#include "include/cef_drag_data.h"
|
||||
#include "include/internal/cef_types.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 "content/public/browser/web_contents.h"
|
||||
@@ -56,7 +56,7 @@ class CefBrowserPlatformDelegate {
|
||||
static std::unique_ptr<CefBrowserPlatformDelegate> Create(
|
||||
CefBrowserHostBase::CreateParams& create_params);
|
||||
|
||||
// Called from CefBrowserHostImpl::Create.
|
||||
// Called from AlloyBrowserHostImpl::Create.
|
||||
// Wait for the call to WebContentsCreated(owned=true) before taking ownership
|
||||
// of the resulting WebContents object.
|
||||
virtual content::WebContents* CreateWebContents(
|
||||
@@ -103,12 +103,12 @@ class CefBrowserPlatformDelegate {
|
||||
// See WebContentsObserver documentation.
|
||||
virtual void RenderViewReady();
|
||||
|
||||
// Called after the owning CefBrowserHostImpl is created. Will only be called
|
||||
// a single time per instance. Do not send any client notifications from this
|
||||
// method.
|
||||
virtual void BrowserCreated(CefBrowserHostImpl* browser);
|
||||
// Called after the owning AlloyBrowserHostImpl is created. Will only be
|
||||
// called a single time per instance. Do not send any client notifications
|
||||
// from this method.
|
||||
virtual void BrowserCreated(AlloyBrowserHostImpl* browser);
|
||||
|
||||
// Called from CefBrowserHostImpl::Create.
|
||||
// Called from AlloyBrowserHostImpl::Create.
|
||||
virtual void CreateExtensionHost(const extensions::Extension* extension,
|
||||
const GURL& url,
|
||||
extensions::ViewType host_type);
|
||||
@@ -124,11 +124,11 @@ class CefBrowserPlatformDelegate {
|
||||
// BrowserDestroyed().
|
||||
virtual void NotifyBrowserDestroyed();
|
||||
|
||||
// Called before the owning CefBrowserHostImpl is destroyed. Will only be
|
||||
// called a single time per instance. All references to the CefBrowserHostImpl
|
||||
// and WebContents should be cleared when this method is called. Do not send
|
||||
// any client notifications from this method.
|
||||
virtual void BrowserDestroyed(CefBrowserHostImpl* browser);
|
||||
// Called before the owning AlloyBrowserHostImpl is destroyed. Will only be
|
||||
// called a single time per instance. All references to the
|
||||
// AlloyBrowserHostImpl and WebContents should be cleared when this method is
|
||||
// called. Do not send any client notifications from this method.
|
||||
virtual void BrowserDestroyed(AlloyBrowserHostImpl* browser);
|
||||
|
||||
// Create the window that hosts the browser. Will only be called a single time
|
||||
// per instance. Only used with windowed rendering.
|
||||
@@ -156,7 +156,7 @@ class CefBrowserPlatformDelegate {
|
||||
#endif
|
||||
|
||||
// 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
|
||||
// method will be called before WebContentsCreated() is called on
|
||||
// |new_platform_delegate|. Do not make the new browser visible in this
|
||||
@@ -168,13 +168,13 @@ class CefBrowserPlatformDelegate {
|
||||
CefBrowserPlatformDelegate* new_platform_delegate,
|
||||
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
|
||||
// DevTools. This method will be called immediately after
|
||||
// CefLifeSpanHandler::OnAfterCreated() for the popup browser. It is safe to
|
||||
// make the new browser visible in this callback (for example, add the browser
|
||||
// to a window and show it).
|
||||
virtual void PopupBrowserCreated(CefBrowserHostImpl* new_browser,
|
||||
virtual void PopupBrowserCreated(AlloyBrowserHostImpl* new_browser,
|
||||
bool is_devtools);
|
||||
|
||||
// Returns the background color for the browser. The alpha component will be
|
||||
@@ -343,7 +343,7 @@ class CefBrowserPlatformDelegate {
|
||||
|
||||
// Not owned by this object.
|
||||
content::WebContents* web_contents_ = nullptr;
|
||||
CefBrowserHostImpl* browser_ = nullptr;
|
||||
AlloyBrowserHostImpl* browser_ = nullptr;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefBrowserPlatformDelegate);
|
||||
};
|
||||
|
@@ -17,14 +17,11 @@
|
||||
#include "base/threading/platform_thread.h"
|
||||
#include "third_party/skia/include/core/SkColor.h"
|
||||
|
||||
class CefBrowserHostImpl;
|
||||
class CefBrowserInfoManager;
|
||||
class CefTraceSubscriber;
|
||||
|
||||
class CefContext {
|
||||
public:
|
||||
typedef std::list<CefRefPtr<CefBrowserHostImpl>> BrowserList;
|
||||
|
||||
// Interface to implement for observers that wish to be informed of changes
|
||||
// to the context. All methods will be called on the UI thread.
|
||||
class Observer {
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
#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/callback.h"
|
||||
@@ -39,7 +39,8 @@ void AppendToFile(const base::FilePath& path, const std::string& content) {
|
||||
|
||||
} // namespace
|
||||
|
||||
CefDevToolsFileManager::CefDevToolsFileManager(CefBrowserHostImpl* browser_impl,
|
||||
CefDevToolsFileManager::CefDevToolsFileManager(
|
||||
AlloyBrowserHostImpl* browser_impl,
|
||||
PrefService* prefs)
|
||||
: browser_impl_(browser_impl),
|
||||
prefs_(prefs),
|
||||
|
@@ -18,7 +18,7 @@ class SequencedTaskRunner;
|
||||
class Value;
|
||||
} // namespace base
|
||||
|
||||
class CefBrowserHostImpl;
|
||||
class AlloyBrowserHostImpl;
|
||||
class PrefService;
|
||||
|
||||
// File management helper for DevTools.
|
||||
@@ -26,7 +26,8 @@ class PrefService;
|
||||
// chrome/browser/devtools/devtools_file_helper.cc.
|
||||
class CefDevToolsFileManager {
|
||||
public:
|
||||
CefDevToolsFileManager(CefBrowserHostImpl* browser_impl, PrefService* prefs);
|
||||
CefDevToolsFileManager(AlloyBrowserHostImpl* browser_impl,
|
||||
PrefService* prefs);
|
||||
|
||||
void SaveToFile(const std::string& url,
|
||||
const std::string& content,
|
||||
@@ -68,7 +69,7 @@ class CefDevToolsFileManager {
|
||||
const base::Value* arg3);
|
||||
|
||||
// Guaranteed to outlive this object.
|
||||
CefBrowserHostImpl* browser_impl_;
|
||||
AlloyBrowserHostImpl* browser_impl_;
|
||||
PrefService* prefs_;
|
||||
|
||||
typedef std::map<std::string, base::FilePath> PathsMap;
|
||||
|
@@ -235,7 +235,7 @@ const size_t kMaxMessageChunkSize = IPC::Channel::kMaximumMessageSize / 4;
|
||||
|
||||
// static
|
||||
CefDevToolsFrontend* CefDevToolsFrontend::Show(
|
||||
CefBrowserHostImpl* inspected_browser,
|
||||
AlloyBrowserHostImpl* inspected_browser,
|
||||
const CefWindowInfo& windowInfo,
|
||||
CefRefPtr<CefClient> client,
|
||||
const CefBrowserSettings& settings,
|
||||
@@ -258,15 +258,15 @@ CefDevToolsFrontend* CefDevToolsFrontend::Show(
|
||||
create_params.request_context = inspected_browser->GetRequestContext();
|
||||
create_params.extra_info = inspected_browser->browser_info()->extra_info();
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl> frontend_browser =
|
||||
CefBrowserHostImpl::Create(create_params);
|
||||
CefRefPtr<AlloyBrowserHostImpl> frontend_browser =
|
||||
AlloyBrowserHostImpl::Create(create_params);
|
||||
|
||||
content::WebContents* inspected_contents = inspected_browser->web_contents();
|
||||
|
||||
// CefDevToolsFrontend will delete itself when the frontend WebContents is
|
||||
// destroyed.
|
||||
CefDevToolsFrontend* devtools_frontend = new CefDevToolsFrontend(
|
||||
static_cast<CefBrowserHostImpl*>(frontend_browser.get()),
|
||||
static_cast<AlloyBrowserHostImpl*>(frontend_browser.get()),
|
||||
inspected_contents, inspect_element_at,
|
||||
std::move(frontend_destroyed_callback));
|
||||
|
||||
@@ -293,12 +293,12 @@ void CefDevToolsFrontend::InspectElementAt(int x, int y) {
|
||||
|
||||
void CefDevToolsFrontend::Close() {
|
||||
base::PostTask(FROM_HERE, {content::BrowserThread::UI},
|
||||
base::Bind(&CefBrowserHostImpl::CloseBrowser,
|
||||
base::Bind(&AlloyBrowserHostImpl::CloseBrowser,
|
||||
frontend_browser_.get(), true));
|
||||
}
|
||||
|
||||
CefDevToolsFrontend::CefDevToolsFrontend(
|
||||
CefBrowserHostImpl* frontend_browser,
|
||||
AlloyBrowserHostImpl* frontend_browser,
|
||||
content::WebContents* inspected_contents,
|
||||
const CefPoint& inspect_element_at,
|
||||
base::OnceClosure frontend_destroyed_callback)
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#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 "base/compiler_specific.h"
|
||||
@@ -42,7 +42,7 @@ class CefDevToolsFrontend : public content::WebContentsObserver,
|
||||
public content::DevToolsAgentHostClient {
|
||||
public:
|
||||
static CefDevToolsFrontend* Show(
|
||||
CefBrowserHostImpl* inspected_browser,
|
||||
AlloyBrowserHostImpl* inspected_browser,
|
||||
const CefWindowInfo& windowInfo,
|
||||
CefRefPtr<CefClient> client,
|
||||
const CefBrowserSettings& settings,
|
||||
@@ -60,7 +60,7 @@ class CefDevToolsFrontend : public content::WebContentsObserver,
|
||||
const base::Value* arg3);
|
||||
|
||||
private:
|
||||
CefDevToolsFrontend(CefBrowserHostImpl* frontend_browser,
|
||||
CefDevToolsFrontend(AlloyBrowserHostImpl* frontend_browser,
|
||||
content::WebContents* inspected_contents,
|
||||
const CefPoint& inspect_element_at,
|
||||
base::OnceClosure destroyed_callback);
|
||||
@@ -87,7 +87,7 @@ class CefDevToolsFrontend : public content::WebContentsObserver,
|
||||
|
||||
PrefService* GetPrefs() const;
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl> frontend_browser_;
|
||||
CefRefPtr<AlloyBrowserHostImpl> frontend_browser_;
|
||||
content::WebContents* inspected_contents_;
|
||||
scoped_refptr<content::DevToolsAgentHost> agent_host_;
|
||||
CefPoint inspect_element_at_;
|
||||
|
@@ -31,7 +31,7 @@ class CefDevToolsRegistrationImpl : public CefRegistration,
|
||||
controller_->RemoveObserver(this);
|
||||
}
|
||||
|
||||
void Initialize(CefBrowserHostImpl* browser,
|
||||
void Initialize(AlloyBrowserHostImpl* browser,
|
||||
base::WeakPtr<CefDevToolsController> controller) {
|
||||
CEF_REQUIRE_UIT();
|
||||
DCHECK(browser && controller);
|
||||
@@ -83,7 +83,7 @@ class CefDevToolsRegistrationImpl : public CefRegistration,
|
||||
|
||||
CefRefPtr<CefDevToolsMessageObserver> observer_;
|
||||
|
||||
CefBrowserHostImpl* browser_ = nullptr;
|
||||
AlloyBrowserHostImpl* browser_ = nullptr;
|
||||
base::WeakPtr<CefDevToolsController> controller_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefDevToolsRegistrationImpl);
|
||||
@@ -92,7 +92,7 @@ class CefDevToolsRegistrationImpl : public CefRegistration,
|
||||
|
||||
} // namespace
|
||||
|
||||
CefDevToolsManager::CefDevToolsManager(CefBrowserHostImpl* inspected_browser)
|
||||
CefDevToolsManager::CefDevToolsManager(AlloyBrowserHostImpl* inspected_browser)
|
||||
: inspected_browser_(inspected_browser), weak_ptr_factory_(this) {
|
||||
CEF_REQUIRE_UIT();
|
||||
}
|
||||
|
@@ -10,7 +10,7 @@
|
||||
|
||||
#include "base/memory/weak_ptr.h"
|
||||
|
||||
class CefBrowserHostImpl;
|
||||
class AlloyBrowserHostImpl;
|
||||
class CefDevToolsController;
|
||||
class CefDevToolsFrontend;
|
||||
|
||||
@@ -23,7 +23,7 @@ class WebContents;
|
||||
class CefDevToolsManager {
|
||||
public:
|
||||
// |inspected_browser| will outlive this object.
|
||||
explicit CefDevToolsManager(CefBrowserHostImpl* inspected_browser);
|
||||
explicit CefDevToolsManager(AlloyBrowserHostImpl* inspected_browser);
|
||||
~CefDevToolsManager();
|
||||
|
||||
// See CefBrowserHost methods of the same name for documentation.
|
||||
@@ -52,7 +52,7 @@ class CefDevToolsManager {
|
||||
|
||||
bool EnsureController();
|
||||
|
||||
CefBrowserHostImpl* const inspected_browser_;
|
||||
AlloyBrowserHostImpl* const inspected_browser_;
|
||||
|
||||
// CefDevToolsFrontend will delete itself when the frontend WebContents is
|
||||
// destroyed.
|
||||
|
@@ -8,8 +8,6 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "libcef/browser/browser_host_impl.h"
|
||||
|
||||
#include "base/atomicops.h"
|
||||
#include "base/bind.h"
|
||||
#include "base/command_line.h"
|
||||
|
@@ -5,7 +5,7 @@
|
||||
#include "libcef/browser/download_manager_delegate.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/download_item_impl.h"
|
||||
#include "libcef/browser/thread_util.h"
|
||||
@@ -31,7 +31,7 @@ namespace {
|
||||
|
||||
// Helper function to retrieve the CefDownloadHandler.
|
||||
CefRefPtr<CefDownloadHandler> GetDownloadHandler(
|
||||
CefRefPtr<CefBrowserHostImpl> browser) {
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser) {
|
||||
CefRefPtr<CefClient> client = browser->GetClient();
|
||||
if (client.get())
|
||||
return client->GetDownloadHandler();
|
||||
@@ -125,8 +125,8 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback {
|
||||
if (show_dialog) {
|
||||
WebContents* web_contents =
|
||||
content::DownloadItemUtils::GetWebContents(item);
|
||||
CefRefPtr<CefBrowserHostImpl> browser =
|
||||
CefBrowserHostImpl::GetBrowserForContents(web_contents);
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser =
|
||||
AlloyBrowserHostImpl::GetBrowserForContents(web_contents);
|
||||
if (browser.get()) {
|
||||
handled = true;
|
||||
|
||||
@@ -276,7 +276,7 @@ CefDownloadManagerDelegate::~CefDownloadManagerDelegate() {
|
||||
}
|
||||
|
||||
void CefDownloadManagerDelegate::OnDownloadUpdated(DownloadItem* download) {
|
||||
CefRefPtr<CefBrowserHostImpl> browser = GetBrowser(download);
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser = GetBrowser(download);
|
||||
CefRefPtr<CefDownloadHandler> handler;
|
||||
if (browser.get())
|
||||
handler = GetDownloadHandler(browser);
|
||||
@@ -296,7 +296,7 @@ void CefDownloadManagerDelegate::OnDownloadUpdated(DownloadItem* download) {
|
||||
void CefDownloadManagerDelegate::OnDownloadDestroyed(DownloadItem* item) {
|
||||
item->RemoveObserver(this);
|
||||
|
||||
CefBrowserHostImpl* browser = nullptr;
|
||||
AlloyBrowserHostImpl* browser = nullptr;
|
||||
|
||||
ItemBrowserMap::iterator it = item_browser_map_.find(item);
|
||||
DCHECK(it != item_browser_map_.end());
|
||||
@@ -326,7 +326,7 @@ void CefDownloadManagerDelegate::OnDownloadCreated(DownloadManager* manager,
|
||||
DownloadItem* item) {
|
||||
// This callback may arrive after DetermineDownloadTarget, so we allow
|
||||
// association from either method.
|
||||
CefRefPtr<CefBrowserHostImpl> browser = GetOrAssociateBrowser(item);
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser = GetOrAssociateBrowser(item);
|
||||
if (!browser) {
|
||||
// If the download is rejected (e.g. ALT+click on an invalid protocol link)
|
||||
// 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
|
||||
// from either method.
|
||||
CefRefPtr<CefBrowserHostImpl> browser = GetOrAssociateBrowser(item);
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser = GetOrAssociateBrowser(item);
|
||||
CefRefPtr<CefDownloadHandler> handler;
|
||||
if (browser.get())
|
||||
handler = GetDownloadHandler(browser);
|
||||
@@ -418,17 +418,17 @@ void CefDownloadManagerDelegate::OnBrowserDestroyed(
|
||||
}
|
||||
}
|
||||
|
||||
CefBrowserHostImpl* CefDownloadManagerDelegate::GetOrAssociateBrowser(
|
||||
AlloyBrowserHostImpl* CefDownloadManagerDelegate::GetOrAssociateBrowser(
|
||||
download::DownloadItem* item) {
|
||||
ItemBrowserMap::const_iterator it = item_browser_map_.find(item);
|
||||
if (it != item_browser_map_.end())
|
||||
return it->second;
|
||||
|
||||
CefBrowserHostImpl* browser = nullptr;
|
||||
AlloyBrowserHostImpl* browser = nullptr;
|
||||
content::WebContents* contents =
|
||||
content::DownloadItemUtils::GetWebContents(item);
|
||||
if (contents) {
|
||||
browser = CefBrowserHostImpl::GetBrowserForContents(contents).get();
|
||||
browser = AlloyBrowserHostImpl::GetBrowserForContents(contents).get();
|
||||
DCHECK(browser);
|
||||
}
|
||||
if (!browser)
|
||||
@@ -446,7 +446,8 @@ CefBrowserHostImpl* CefDownloadManagerDelegate::GetOrAssociateBrowser(
|
||||
return browser;
|
||||
}
|
||||
|
||||
CefBrowserHostImpl* CefDownloadManagerDelegate::GetBrowser(DownloadItem* item) {
|
||||
AlloyBrowserHostImpl* CefDownloadManagerDelegate::GetBrowser(
|
||||
DownloadItem* item) {
|
||||
ItemBrowserMap::const_iterator it = item_browser_map_.find(item);
|
||||
if (it != item_browser_map_.end())
|
||||
return it->second;
|
||||
|
@@ -16,7 +16,7 @@
|
||||
#include "content/public/browser/download_manager.h"
|
||||
#include "content/public/browser/download_manager_delegate.h"
|
||||
|
||||
class CefBrowserHostImpl;
|
||||
class AlloyBrowserHostImpl;
|
||||
|
||||
class CefDownloadManagerDelegate : public download::DownloadItem::Observer,
|
||||
public content::DownloadManager::Observer,
|
||||
@@ -46,16 +46,17 @@ class CefDownloadManagerDelegate : public download::DownloadItem::Observer,
|
||||
// CefBrowserHostBase::Observer methods.
|
||||
void OnBrowserDestroyed(CefBrowserHostBase* browser) override;
|
||||
|
||||
CefBrowserHostImpl* GetOrAssociateBrowser(download::DownloadItem* item);
|
||||
CefBrowserHostImpl* GetBrowser(download::DownloadItem* item);
|
||||
AlloyBrowserHostImpl* GetOrAssociateBrowser(download::DownloadItem* item);
|
||||
AlloyBrowserHostImpl* GetBrowser(download::DownloadItem* item);
|
||||
|
||||
content::DownloadManager* manager_;
|
||||
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
|
||||
// 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_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefDownloadManagerDelegate);
|
||||
|
@@ -119,7 +119,7 @@ ExecuteCodeFunction::InitResult ExecuteCodeInTabFunction::Init() {
|
||||
|
||||
// Find a browser that we can access, or fail with error.
|
||||
std::string error;
|
||||
CefRefPtr<CefBrowserHostImpl> browser =
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser =
|
||||
cef_details_.GetBrowserForTabIdFirstTime(tab_id, &error);
|
||||
if (!browser)
|
||||
return set_init_result_error(error);
|
||||
@@ -133,7 +133,7 @@ ExecuteCodeFunction::InitResult ExecuteCodeInTabFunction::Init() {
|
||||
bool ExecuteCodeInTabFunction::CanExecuteScriptOnPage(std::string* error) {
|
||||
CHECK_GE(execute_tab_id_, 0);
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl> browser =
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser =
|
||||
cef_details_.GetBrowserForTabIdAgain(execute_tab_id_, error);
|
||||
if (!browser)
|
||||
return false;
|
||||
@@ -188,7 +188,7 @@ ScriptExecutor* ExecuteCodeInTabFunction::GetScriptExecutor(
|
||||
std::string* error) {
|
||||
CHECK_GE(execute_tab_id_, 0);
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl> browser =
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser =
|
||||
cef_details_.GetBrowserForTabIdAgain(execute_tab_id_, error);
|
||||
if (!browser)
|
||||
return nullptr;
|
||||
@@ -237,7 +237,7 @@ ZoomAPIFunction::ZoomAPIFunction() : cef_details_(this) {}
|
||||
|
||||
content::WebContents* ZoomAPIFunction::GetWebContents(int tab_id) {
|
||||
// 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_);
|
||||
if (!browser)
|
||||
return nullptr;
|
||||
|
@@ -4,9 +4,9 @@
|
||||
|
||||
#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_host_base.h"
|
||||
#include "libcef/browser/browser_host_impl.h"
|
||||
#include "libcef/browser/browser_info_manager.h"
|
||||
#include "libcef/browser/thread_util.h"
|
||||
#include "libcef/common/extensions/extensions_util.h"
|
||||
@@ -146,7 +146,7 @@ CefRefPtr<CefBrowserHostBase> GetOwnerBrowserForHost(
|
||||
return browser;
|
||||
}
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl> GetBrowserForTabId(
|
||||
CefRefPtr<AlloyBrowserHostImpl> GetBrowserForTabId(
|
||||
int tab_id,
|
||||
content::BrowserContext* browser_context) {
|
||||
REQUIRE_ALLOY_RUNTIME();
|
||||
@@ -160,8 +160,8 @@ CefRefPtr<CefBrowserHostImpl> GetBrowserForTabId(
|
||||
|
||||
for (const auto& browser_info :
|
||||
CefBrowserInfoManager::GetInstance()->GetBrowserInfoList()) {
|
||||
CefRefPtr<CefBrowserHostImpl> current_browser =
|
||||
static_cast<CefBrowserHostImpl*>(browser_info->browser().get());
|
||||
CefRefPtr<AlloyBrowserHostImpl> current_browser =
|
||||
static_cast<AlloyBrowserHostImpl*>(browser_info->browser().get());
|
||||
if (current_browser && current_browser->GetIdentifier() == tab_id) {
|
||||
// Make sure we're operating in the same CefBrowserContext.
|
||||
if (CefBrowserContext::FromBrowserContext(
|
||||
|
@@ -19,7 +19,7 @@ class WebContents;
|
||||
} // namespace content
|
||||
|
||||
class CefBrowserHostBase;
|
||||
class CefBrowserHostImpl;
|
||||
class AlloyBrowserHostImpl;
|
||||
|
||||
namespace extensions {
|
||||
|
||||
@@ -60,7 +60,7 @@ CefRefPtr<CefBrowserHostBase> GetOwnerBrowserForHost(
|
||||
// Returns the browser matching |tab_id| and |browser_context|. Returns false if
|
||||
// |tab_id| is < 0 or a matching browser cannot be found within
|
||||
// |browser_context|. Similar in concept to ExtensionTabUtil::GetTabById.
|
||||
CefRefPtr<CefBrowserHostImpl> GetBrowserForTabId(
|
||||
CefRefPtr<AlloyBrowserHostImpl> GetBrowserForTabId(
|
||||
int tab_id,
|
||||
content::BrowserContext* browser_context);
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
|
||||
#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 "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
|
||||
// so the call stack has a chance to unwind.
|
||||
CEF_POST_TASK(CEF_UIT,
|
||||
base::Bind(&CefBrowserHostImpl::WindowDestroyed, browser_));
|
||||
base::Bind(&AlloyBrowserHostImpl::WindowDestroyed, browser_));
|
||||
}
|
||||
|
||||
CefWindowHandle CefBrowserPlatformDelegateBackground::GetHostWindowHandle()
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
#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 "base/callback.h"
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace extensions {
|
||||
|
||||
CefExtensionBackgroundHost::CefExtensionBackgroundHost(
|
||||
CefBrowserHostImpl* browser,
|
||||
AlloyBrowserHostImpl* browser,
|
||||
base::OnceClosure deleted_callback,
|
||||
const Extension* extension,
|
||||
content::WebContents* host_contents,
|
||||
|
@@ -11,7 +11,7 @@
|
||||
#include "base/macros.h"
|
||||
#include "extensions/browser/extension_host.h"
|
||||
|
||||
class CefBrowserHostImpl;
|
||||
class AlloyBrowserHostImpl;
|
||||
|
||||
namespace content {
|
||||
class WebContents;
|
||||
@@ -24,7 +24,7 @@ namespace extensions {
|
||||
// is managed by ProcessManager.
|
||||
class CefExtensionBackgroundHost : public ExtensionHost {
|
||||
public:
|
||||
CefExtensionBackgroundHost(CefBrowserHostImpl* browser,
|
||||
CefExtensionBackgroundHost(AlloyBrowserHostImpl* browser,
|
||||
base::OnceClosure deleted_callback,
|
||||
const Extension* extension,
|
||||
content::WebContents* host_contents,
|
||||
|
@@ -143,18 +143,18 @@ Profile* CefExtensionFunctionDetails::GetProfile() const {
|
||||
return Profile::FromBrowserContext(function_->browser_context());
|
||||
}
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl> CefExtensionFunctionDetails::GetSenderBrowser()
|
||||
CefRefPtr<AlloyBrowserHostImpl> CefExtensionFunctionDetails::GetSenderBrowser()
|
||||
const {
|
||||
content::WebContents* web_contents = function_->GetSenderWebContents();
|
||||
if (web_contents)
|
||||
return CefBrowserHostImpl::GetBrowserForContents(web_contents);
|
||||
return AlloyBrowserHostImpl::GetBrowserForContents(web_contents);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl> CefExtensionFunctionDetails::GetCurrentBrowser()
|
||||
CefRefPtr<AlloyBrowserHostImpl> CefExtensionFunctionDetails::GetCurrentBrowser()
|
||||
const {
|
||||
// Start with the browser hosting the extension.
|
||||
CefRefPtr<CefBrowserHostImpl> browser = GetSenderBrowser();
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser = GetSenderBrowser();
|
||||
if (browser && browser->client()) {
|
||||
CefRefPtr<CefExtensionHandler> handler = GetCefExtension()->GetHandler();
|
||||
if (handler) {
|
||||
@@ -163,8 +163,8 @@ CefRefPtr<CefBrowserHostImpl> CefExtensionFunctionDetails::GetCurrentBrowser()
|
||||
handler->GetActiveBrowser(GetCefExtension(), browser.get(),
|
||||
function_->include_incognito_information());
|
||||
if (active_browser && active_browser != browser) {
|
||||
CefRefPtr<CefBrowserHostImpl> active_browser_impl =
|
||||
static_cast<CefBrowserHostImpl*>(active_browser.get());
|
||||
CefRefPtr<AlloyBrowserHostImpl> active_browser_impl =
|
||||
static_cast<AlloyBrowserHostImpl*>(active_browser.get());
|
||||
|
||||
// Make sure we're operating in the same CefBrowserContext.
|
||||
if (CefBrowserContext::FromBrowserContext(
|
||||
@@ -187,11 +187,11 @@ CefRefPtr<CefBrowserHostImpl> CefExtensionFunctionDetails::GetCurrentBrowser()
|
||||
}
|
||||
|
||||
bool CefExtensionFunctionDetails::CanAccessBrowser(
|
||||
CefRefPtr<CefBrowserHostImpl> target) const {
|
||||
CefRefPtr<AlloyBrowserHostImpl> target) const {
|
||||
DCHECK(target);
|
||||
|
||||
// Start with the browser hosting the extension.
|
||||
CefRefPtr<CefBrowserHostImpl> browser = GetSenderBrowser();
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser = GetSenderBrowser();
|
||||
if (browser == target) {
|
||||
// A sender can always access itself.
|
||||
return true;
|
||||
@@ -210,14 +210,14 @@ bool CefExtensionFunctionDetails::CanAccessBrowser(
|
||||
return true;
|
||||
}
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl>
|
||||
CefRefPtr<AlloyBrowserHostImpl>
|
||||
CefExtensionFunctionDetails::GetBrowserForTabIdFirstTime(
|
||||
int tab_id,
|
||||
std::string* error_message) const {
|
||||
DCHECK(!get_browser_called_first_time_);
|
||||
get_browser_called_first_time_ = true;
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl> browser;
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser;
|
||||
|
||||
if (tab_id >= 0) {
|
||||
// May be an invalid tabId or in the wrong BrowserContext.
|
||||
@@ -243,7 +243,7 @@ CefExtensionFunctionDetails::GetBrowserForTabIdFirstTime(
|
||||
return browser;
|
||||
}
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl>
|
||||
CefRefPtr<AlloyBrowserHostImpl>
|
||||
CefExtensionFunctionDetails::GetBrowserForTabIdAgain(
|
||||
int tab_id,
|
||||
std::string* error_message) const {
|
||||
@@ -251,7 +251,7 @@ CefExtensionFunctionDetails::GetBrowserForTabIdAgain(
|
||||
DCHECK(get_browser_called_first_time_);
|
||||
|
||||
// May return NULL during shutdown.
|
||||
CefRefPtr<CefBrowserHostImpl> browser =
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser =
|
||||
GetBrowserForTabId(tab_id, function_->browser_context());
|
||||
if (!browser || !browser->web_contents()) {
|
||||
if (error_message) {
|
||||
@@ -265,7 +265,7 @@ CefExtensionFunctionDetails::GetBrowserForTabIdAgain(
|
||||
bool CefExtensionFunctionDetails::LoadFile(const std::string& file,
|
||||
LoadFileCallback callback) const {
|
||||
// Start with the browser hosting the extension.
|
||||
CefRefPtr<CefBrowserHostImpl> browser = GetSenderBrowser();
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser = GetSenderBrowser();
|
||||
if (browser && browser->client()) {
|
||||
CefRefPtr<CefExtensionHandler> handler = GetCefExtension()->GetHandler();
|
||||
if (handler) {
|
||||
@@ -290,7 +290,7 @@ base::DictionaryValue* CefExtensionFunctionDetails::OpenTab(
|
||||
const OpenTabParams& params,
|
||||
bool user_gesture,
|
||||
std::string* error_message) const {
|
||||
CefRefPtr<CefBrowserHostImpl> sender_browser = GetSenderBrowser();
|
||||
CefRefPtr<AlloyBrowserHostImpl> sender_browser = GetSenderBrowser();
|
||||
if (!sender_browser)
|
||||
return nullptr;
|
||||
|
||||
@@ -301,7 +301,7 @@ base::DictionaryValue* CefExtensionFunctionDetails::OpenTab(
|
||||
|
||||
// CEF doesn't have the concept of windows containing tab strips so we'll
|
||||
// select an "active browser" for BrowserContext sharing instead.
|
||||
CefRefPtr<CefBrowserHostImpl> active_browser =
|
||||
CefRefPtr<AlloyBrowserHostImpl> active_browser =
|
||||
GetBrowserForTabIdFirstTime(window_id, error_message);
|
||||
if (!active_browser)
|
||||
return nullptr;
|
||||
@@ -394,8 +394,8 @@ base::DictionaryValue* CefExtensionFunctionDetails::OpenTab(
|
||||
}
|
||||
|
||||
// Browser creation may fail under certain rare circumstances.
|
||||
CefRefPtr<CefBrowserHostImpl> new_browser =
|
||||
CefBrowserHostImpl::Create(create_params);
|
||||
CefRefPtr<AlloyBrowserHostImpl> new_browser =
|
||||
AlloyBrowserHostImpl::Create(create_params);
|
||||
if (!new_browser)
|
||||
return nullptr;
|
||||
|
||||
@@ -412,7 +412,7 @@ base::DictionaryValue* CefExtensionFunctionDetails::OpenTab(
|
||||
}
|
||||
|
||||
std::unique_ptr<api::tabs::Tab> CefExtensionFunctionDetails::CreateTabObject(
|
||||
CefRefPtr<CefBrowserHostImpl> new_browser,
|
||||
CefRefPtr<AlloyBrowserHostImpl> new_browser,
|
||||
int opener_browser_id,
|
||||
bool active,
|
||||
int index) const {
|
||||
|
@@ -5,7 +5,7 @@
|
||||
#ifndef 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"
|
||||
|
||||
@@ -36,7 +36,7 @@ class CefExtensionFunctionDetails {
|
||||
|
||||
// Get the "sender" browser that is hosting the extension. May return NULL
|
||||
// during startup/shutdown.
|
||||
CefRefPtr<CefBrowserHostImpl> GetSenderBrowser() const;
|
||||
CefRefPtr<AlloyBrowserHostImpl> GetSenderBrowser() const;
|
||||
|
||||
// Get the "current" browser that will be acted on by this extension function,
|
||||
// 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
|
||||
// happen if only incognito windows are open, or early in startup or shutdown
|
||||
// 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
|
||||
// tabId use the GetBrowserForTabId* methods instead of calling this method
|
||||
// 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
|
||||
// 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
|
||||
// be called one time per extension function and will check all necessary
|
||||
// client permissions.
|
||||
CefRefPtr<CefBrowserHostImpl> GetBrowserForTabIdFirstTime(
|
||||
CefRefPtr<AlloyBrowserHostImpl> GetBrowserForTabIdFirstTime(
|
||||
int tab_id,
|
||||
std::string* error_message) const;
|
||||
|
||||
@@ -79,7 +79,7 @@ class CefExtensionFunctionDetails {
|
||||
// |error_message| can optionally be passed in and will be set with an
|
||||
// appropriate message on error. This method should be called only after
|
||||
// GetBrowserForTabIdFirstTime() has succeeded for the same |tab_id|.
|
||||
CefRefPtr<CefBrowserHostImpl> GetBrowserForTabIdAgain(
|
||||
CefRefPtr<AlloyBrowserHostImpl> GetBrowserForTabIdAgain(
|
||||
int tab_id,
|
||||
std::string* error_message) const;
|
||||
|
||||
@@ -114,7 +114,7 @@ class CefExtensionFunctionDetails {
|
||||
// permissions of the extension, the object may or may not include sensitive
|
||||
// data such as the tab's URL.
|
||||
std::unique_ptr<api::tabs::Tab> CreateTabObject(
|
||||
CefRefPtr<CefBrowserHostImpl> new_browser,
|
||||
CefRefPtr<AlloyBrowserHostImpl> new_browser,
|
||||
int opener_browser_id,
|
||||
bool active,
|
||||
int index) const;
|
||||
|
@@ -13,7 +13,7 @@
|
||||
namespace extensions {
|
||||
|
||||
CefExtensionHostDelegate::CefExtensionHostDelegate(
|
||||
CefBrowserHostImpl* browser) {}
|
||||
AlloyBrowserHostImpl* browser) {}
|
||||
|
||||
CefExtensionHostDelegate::~CefExtensionHostDelegate() {}
|
||||
|
||||
@@ -25,7 +25,7 @@ void CefExtensionHostDelegate::OnRenderViewCreatedForBackgroundPage(
|
||||
|
||||
content::JavaScriptDialogManager*
|
||||
CefExtensionHostDelegate::GetJavaScriptDialogManager() {
|
||||
// Never routed here from CefBrowserHostImpl.
|
||||
// Never routed here from AlloyBrowserHostImpl.
|
||||
NOTREACHED();
|
||||
return nullptr;
|
||||
}
|
||||
@@ -45,7 +45,7 @@ void CefExtensionHostDelegate::ProcessMediaAccessRequest(
|
||||
const content::MediaStreamRequest& request,
|
||||
content::MediaResponseCallback callback,
|
||||
const Extension* extension) {
|
||||
// Never routed here from CefBrowserHostImpl.
|
||||
// Never routed here from AlloyBrowserHostImpl.
|
||||
NOTREACHED();
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ bool CefExtensionHostDelegate::CheckMediaAccessPermission(
|
||||
const GURL& security_origin,
|
||||
blink::mojom::MediaStreamType type,
|
||||
const Extension* extension) {
|
||||
// Never routed here from CefBrowserHostImpl.
|
||||
// Never routed here from AlloyBrowserHostImpl.
|
||||
NOTREACHED();
|
||||
return false;
|
||||
}
|
||||
|
@@ -8,13 +8,13 @@
|
||||
#include "base/macros.h"
|
||||
#include "extensions/browser/extension_host_delegate.h"
|
||||
|
||||
class CefBrowserHostImpl;
|
||||
class AlloyBrowserHostImpl;
|
||||
|
||||
namespace extensions {
|
||||
|
||||
class CefExtensionHostDelegate : public ExtensionHostDelegate {
|
||||
public:
|
||||
explicit CefExtensionHostDelegate(CefBrowserHostImpl* browser);
|
||||
explicit CefExtensionHostDelegate(AlloyBrowserHostImpl* browser);
|
||||
~CefExtensionHostDelegate() override;
|
||||
|
||||
// ExtensionHostDelegate implementation.
|
||||
|
@@ -21,7 +21,7 @@ using content::WebContentsObserver;
|
||||
|
||||
namespace extensions {
|
||||
|
||||
CefExtensionViewHost::CefExtensionViewHost(CefBrowserHostImpl* browser,
|
||||
CefExtensionViewHost::CefExtensionViewHost(AlloyBrowserHostImpl* browser,
|
||||
const Extension* extension,
|
||||
content::WebContents* host_contents,
|
||||
const GURL& url,
|
||||
|
@@ -12,7 +12,7 @@
|
||||
#include "content/public/browser/notification_registrar.h"
|
||||
#include "extensions/browser/extension_host.h"
|
||||
|
||||
class CefBrowserHostImpl;
|
||||
class AlloyBrowserHostImpl;
|
||||
|
||||
namespace content {
|
||||
class WebContents;
|
||||
@@ -22,12 +22,12 @@ namespace extensions {
|
||||
|
||||
// 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
|
||||
// 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.
|
||||
class CefExtensionViewHost : public ExtensionHost,
|
||||
public content::NotificationObserver {
|
||||
public:
|
||||
CefExtensionViewHost(CefBrowserHostImpl* browser,
|
||||
CefExtensionViewHost(AlloyBrowserHostImpl* browser,
|
||||
const Extension* extension,
|
||||
content::WebContents* host_contents,
|
||||
const GURL& url,
|
||||
|
@@ -7,8 +7,8 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "libcef/browser/alloy/alloy_browser_host_impl.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/extension_system.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
|
||||
// background host creation in that case.
|
||||
CefRefPtr<CefBrowserHostImpl> browser =
|
||||
CefBrowserHostImpl::Create(create_params);
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser =
|
||||
AlloyBrowserHostImpl::Create(create_params);
|
||||
if (browser) {
|
||||
*host = browser->GetExtensionHost();
|
||||
DCHECK(*host);
|
||||
|
@@ -5,9 +5,9 @@
|
||||
|
||||
#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/browser_context.h"
|
||||
#include "libcef/browser/browser_host_impl.h"
|
||||
#include "libcef/browser/browser_info.h"
|
||||
#include "libcef/browser/osr/web_contents_view_osr.h"
|
||||
|
||||
@@ -27,8 +27,8 @@ void CefMimeHandlerViewGuestDelegate::OverrideWebContentsCreateParams(
|
||||
content::WebContents::CreateParams* params) {
|
||||
DCHECK(params->guest_delegate);
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl> owner_browser =
|
||||
CefBrowserHostImpl::GetBrowserForContents(owner_web_contents_);
|
||||
CefRefPtr<AlloyBrowserHostImpl> owner_browser =
|
||||
AlloyBrowserHostImpl::GetBrowserForContents(owner_web_contents_);
|
||||
DCHECK(owner_browser);
|
||||
|
||||
if (owner_browser->IsWindowless()) {
|
||||
@@ -43,8 +43,8 @@ void CefMimeHandlerViewGuestDelegate::OnGuestAttached() {
|
||||
content::WebContents* web_contents = guest_->web_contents();
|
||||
DCHECK(web_contents);
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl> owner_browser =
|
||||
CefBrowserHostImpl::GetBrowserForContents(owner_web_contents_);
|
||||
CefRefPtr<AlloyBrowserHostImpl> owner_browser =
|
||||
AlloyBrowserHostImpl::GetBrowserForContents(owner_web_contents_);
|
||||
DCHECK(owner_browser);
|
||||
|
||||
// Associate guest state information with the owner browser.
|
||||
@@ -56,8 +56,8 @@ void CefMimeHandlerViewGuestDelegate::OnGuestDetached() {
|
||||
content::WebContents* web_contents = guest_->web_contents();
|
||||
DCHECK(web_contents);
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl> owner_browser =
|
||||
CefBrowserHostImpl::GetBrowserForContents(owner_web_contents_);
|
||||
CefRefPtr<AlloyBrowserHostImpl> owner_browser =
|
||||
AlloyBrowserHostImpl::GetBrowserForContents(owner_web_contents_);
|
||||
DCHECK(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.y += guest_coordinates.y();
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl> owner_browser =
|
||||
CefBrowserHostImpl::GetBrowserForContents(owner_web_contents_);
|
||||
CefRefPtr<AlloyBrowserHostImpl> owner_browser =
|
||||
AlloyBrowserHostImpl::GetBrowserForContents(owner_web_contents_);
|
||||
DCHECK(owner_browser);
|
||||
|
||||
return owner_browser->HandleContextMenu(web_contents, new_params);
|
||||
|
@@ -8,7 +8,7 @@
|
||||
#include <utility>
|
||||
|
||||
#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 "content/public/browser/file_select_listener.h"
|
||||
@@ -140,7 +140,7 @@ class UploadFolderHelper
|
||||
} // namespace
|
||||
|
||||
CefFileDialogManager::CefFileDialogManager(
|
||||
CefBrowserHostImpl* browser,
|
||||
AlloyBrowserHostImpl* browser,
|
||||
std::unique_ptr<CefFileDialogRunner> runner)
|
||||
: browser_(browser),
|
||||
runner_(std::move(runner)),
|
||||
|
@@ -23,19 +23,19 @@ namespace net {
|
||||
class DirectoryLister;
|
||||
}
|
||||
|
||||
class CefBrowserHostImpl;
|
||||
class AlloyBrowserHostImpl;
|
||||
|
||||
class CefFileDialogManager {
|
||||
public:
|
||||
// |runner| may be NULL if the platform doesn't implement dialogs.
|
||||
CefFileDialogManager(CefBrowserHostImpl* browser,
|
||||
CefFileDialogManager(AlloyBrowserHostImpl* browser,
|
||||
std::unique_ptr<CefFileDialogRunner> runner);
|
||||
~CefFileDialogManager();
|
||||
|
||||
// Delete the runner to free any platform constructs.
|
||||
void Destroy();
|
||||
|
||||
// Called from CefBrowserHostImpl::RunFileChooser.
|
||||
// Called from AlloyBrowserHostImpl::RunFileChooser.
|
||||
// See CefBrowserHost::RunFileDialog documentation.
|
||||
void RunFileDialog(cef_file_dialog_mode_t mode,
|
||||
const CefString& title,
|
||||
@@ -44,7 +44,7 @@ class CefFileDialogManager {
|
||||
int selected_accept_filter,
|
||||
CefRefPtr<CefRunFileDialogCallback> callback);
|
||||
|
||||
// Called from CefBrowserHostImpl::RunFileChooser.
|
||||
// Called from AlloyBrowserHostImpl::RunFileChooser.
|
||||
// See WebContentsDelegate::RunFileChooser documentation.
|
||||
void RunFileChooser(scoped_refptr<content::FileSelectListener> listener,
|
||||
const blink::mojom::FileChooserParams& params);
|
||||
@@ -86,8 +86,8 @@ class CefFileDialogManager {
|
||||
// Clean up state associated with the last run.
|
||||
void Cleanup();
|
||||
|
||||
// CefBrowserHostImpl pointer is guaranteed to outlive this object.
|
||||
CefBrowserHostImpl* browser_;
|
||||
// AlloyBrowserHostImpl pointer is guaranteed to outlive this object.
|
||||
AlloyBrowserHostImpl* browser_;
|
||||
|
||||
std::unique_ptr<CefFileDialogRunner> runner_;
|
||||
|
||||
|
@@ -13,7 +13,7 @@
|
||||
#include "base/files/file_path.h"
|
||||
#include "third_party/blink/public/mojom/choosers/file_chooser.mojom.h"
|
||||
|
||||
class CefBrowserHostImpl;
|
||||
class AlloyBrowserHostImpl;
|
||||
|
||||
class CefFileDialogRunner {
|
||||
public:
|
||||
@@ -34,7 +34,7 @@ class CefFileDialogRunner {
|
||||
RunFileChooserCallback;
|
||||
|
||||
// Display the file chooser dialog. Execute |callback| on completion.
|
||||
virtual void Run(CefBrowserHostImpl* browser,
|
||||
virtual void Run(AlloyBrowserHostImpl* browser,
|
||||
const FileChooserParams& params,
|
||||
RunFileChooserCallback callback) = 0;
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#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 "base/bind.h"
|
||||
@@ -63,7 +63,7 @@ class CefJSDialogCallbackImpl : public CefJSDialogCallback {
|
||||
} // namespace
|
||||
|
||||
CefJavaScriptDialogManager::CefJavaScriptDialogManager(
|
||||
CefBrowserHostImpl* browser,
|
||||
AlloyBrowserHostImpl* browser,
|
||||
std::unique_ptr<CefJavaScriptDialogRunner> runner)
|
||||
: browser_(browser),
|
||||
runner_(std::move(runner)),
|
||||
@@ -144,7 +144,7 @@ void CefJavaScriptDialogManager::RunBeforeUnloadDialog(
|
||||
bool is_reload,
|
||||
DialogClosedCallback callback) {
|
||||
if (browser_->destruction_state() >=
|
||||
CefBrowserHostImpl::DESTRUCTION_STATE_ACCEPTED) {
|
||||
AlloyBrowserHostImpl::DESTRUCTION_STATE_ACCEPTED) {
|
||||
// Currently destroying the browser. Accept the unload without showing
|
||||
// the prompt.
|
||||
std::move(callback).Run(true, base::string16());
|
||||
|
@@ -15,12 +15,12 @@
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "content/public/browser/javascript_dialog_manager.h"
|
||||
|
||||
class CefBrowserHostImpl;
|
||||
class AlloyBrowserHostImpl;
|
||||
|
||||
class CefJavaScriptDialogManager : public content::JavaScriptDialogManager {
|
||||
public:
|
||||
// |runner| may be NULL if the platform doesn't implement dialogs.
|
||||
CefJavaScriptDialogManager(CefBrowserHostImpl* browser,
|
||||
CefJavaScriptDialogManager(AlloyBrowserHostImpl* browser,
|
||||
std::unique_ptr<CefJavaScriptDialogRunner> runner);
|
||||
~CefJavaScriptDialogManager() override;
|
||||
|
||||
@@ -48,8 +48,8 @@ class CefJavaScriptDialogManager : public content::JavaScriptDialogManager {
|
||||
bool success,
|
||||
const base::string16& user_input);
|
||||
|
||||
// CefBrowserHostImpl pointer is guaranteed to outlive this object.
|
||||
CefBrowserHostImpl* browser_;
|
||||
// AlloyBrowserHostImpl pointer is guaranteed to outlive this object.
|
||||
AlloyBrowserHostImpl* browser_;
|
||||
|
||||
std::unique_ptr<CefJavaScriptDialogRunner> runner_;
|
||||
|
||||
|
@@ -11,7 +11,7 @@
|
||||
#include "base/strings/string16.h"
|
||||
#include "content/public/common/javascript_dialog_type.h"
|
||||
|
||||
class CefBrowserHostImpl;
|
||||
class AlloyBrowserHostImpl;
|
||||
|
||||
class CefJavaScriptDialogRunner {
|
||||
public:
|
||||
@@ -20,7 +20,7 @@ class CefJavaScriptDialogRunner {
|
||||
DialogClosedCallback;
|
||||
|
||||
// Run the dialog. Execute |callback| on completion.
|
||||
virtual void Run(CefBrowserHostImpl* browser,
|
||||
virtual void Run(AlloyBrowserHostImpl* browser,
|
||||
content::JavaScriptDialogType message_type,
|
||||
const base::string16& display_url,
|
||||
const base::string16& message_text,
|
||||
|
@@ -6,7 +6,7 @@
|
||||
|
||||
#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/menu_runner.h"
|
||||
#include "libcef/browser/thread_util.h"
|
||||
@@ -86,7 +86,7 @@ class CefRunContextMenuCallbackImpl : public CefRunContextMenuCallback {
|
||||
|
||||
} // namespace
|
||||
|
||||
CefMenuManager::CefMenuManager(CefBrowserHostImpl* browser,
|
||||
CefMenuManager::CefMenuManager(AlloyBrowserHostImpl* browser,
|
||||
std::unique_ptr<CefMenuRunner> runner)
|
||||
: content::WebContentsObserver(browser->web_contents()),
|
||||
browser_(browser),
|
||||
|
@@ -19,13 +19,13 @@ class RenderFrameHost;
|
||||
class WebContents;
|
||||
} // namespace content
|
||||
|
||||
class CefBrowserHostImpl;
|
||||
class AlloyBrowserHostImpl;
|
||||
class CefRunContextMenuCallback;
|
||||
|
||||
class CefMenuManager : public CefMenuModelImpl::Delegate,
|
||||
public content::WebContentsObserver {
|
||||
public:
|
||||
CefMenuManager(CefBrowserHostImpl* browser,
|
||||
CefMenuManager(AlloyBrowserHostImpl* browser,
|
||||
std::unique_ptr<CefMenuRunner> runner);
|
||||
~CefMenuManager() override;
|
||||
|
||||
@@ -59,8 +59,8 @@ class CefMenuManager : public CefMenuModelImpl::Delegate,
|
||||
// Returns true if the specified id is a custom context menu command.
|
||||
bool IsCustomContextMenuCommand(int command_id);
|
||||
|
||||
// CefBrowserHostImpl pointer is guaranteed to outlive this object.
|
||||
CefBrowserHostImpl* browser_;
|
||||
// AlloyBrowserHostImpl pointer is guaranteed to outlive this object.
|
||||
AlloyBrowserHostImpl* browser_;
|
||||
|
||||
std::unique_ptr<CefMenuRunner> runner_;
|
||||
|
||||
|
@@ -14,13 +14,13 @@ namespace content {
|
||||
struct ContextMenuParams;
|
||||
}
|
||||
|
||||
class CefBrowserHostImpl;
|
||||
class AlloyBrowserHostImpl;
|
||||
class CefMenuModelImpl;
|
||||
|
||||
// Provides platform-specific menu implementations for CefMenuCreator.
|
||||
class CefMenuRunner {
|
||||
public:
|
||||
virtual bool RunContextMenu(CefBrowserHostImpl* browser,
|
||||
virtual bool RunContextMenu(AlloyBrowserHostImpl* browser,
|
||||
CefMenuModelImpl* model,
|
||||
const content::ContextMenuParams& params) = 0;
|
||||
virtual void CancelContextMenu() {}
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
#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_widget_host.h"
|
||||
|
@@ -6,7 +6,7 @@
|
||||
|
||||
#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/native/menu_runner_linux.h"
|
||||
#include "libcef/browser/native/window_delegate_view.h"
|
||||
@@ -50,7 +50,7 @@ CefBrowserPlatformDelegateNativeLinux::CefBrowserPlatformDelegateNativeLinux(
|
||||
window_widget_(nullptr) {}
|
||||
|
||||
void CefBrowserPlatformDelegateNativeLinux::BrowserDestroyed(
|
||||
CefBrowserHostImpl* browser) {
|
||||
AlloyBrowserHostImpl* browser) {
|
||||
CefBrowserPlatformDelegateNative::BrowserDestroyed(browser);
|
||||
|
||||
if (host_window_created_) {
|
||||
|
@@ -19,7 +19,7 @@ class CefBrowserPlatformDelegateNativeLinux
|
||||
SkColor background_color);
|
||||
|
||||
// CefBrowserPlatformDelegate methods:
|
||||
void BrowserDestroyed(CefBrowserHostImpl* browser) override;
|
||||
void BrowserDestroyed(AlloyBrowserHostImpl* browser) override;
|
||||
bool CreateHostWindow() override;
|
||||
void CloseHostWindow() override;
|
||||
CefWindowHandle GetHostWindowHandle() const override;
|
||||
|
@@ -19,7 +19,7 @@ class CefBrowserPlatformDelegateNativeMac
|
||||
SkColor background_color);
|
||||
|
||||
// CefBrowserPlatformDelegate methods:
|
||||
void BrowserDestroyed(CefBrowserHostImpl* browser) override;
|
||||
void BrowserDestroyed(AlloyBrowserHostImpl* browser) override;
|
||||
bool CreateHostWindow() override;
|
||||
void CloseHostWindow() override;
|
||||
CefWindowHandle GetHostWindowHandle() const override;
|
||||
|
@@ -7,7 +7,7 @@
|
||||
#import <Cocoa/Cocoa.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/native/file_dialog_runner_mac.h"
|
||||
#include "libcef/browser/native/javascript_dialog_runner_mac.h"
|
||||
@@ -34,10 +34,10 @@
|
||||
// the view is deleted.
|
||||
@interface CefBrowserHostView : NSView {
|
||||
@private
|
||||
CefBrowserHostImpl* browser_; // weak
|
||||
AlloyBrowserHostImpl* browser_; // weak
|
||||
}
|
||||
|
||||
@property(nonatomic, assign) CefBrowserHostImpl* browser;
|
||||
@property(nonatomic, assign) AlloyBrowserHostImpl* browser;
|
||||
|
||||
@end
|
||||
|
||||
@@ -60,15 +60,17 @@
|
||||
// Receives notifications from the browser window. Will delete itself when done.
|
||||
@interface CefWindowDelegate : NSObject <NSWindowDelegate> {
|
||||
@private
|
||||
CefBrowserHostImpl* browser_; // weak
|
||||
AlloyBrowserHostImpl* browser_; // weak
|
||||
NSWindow* window_;
|
||||
}
|
||||
- (id)initWithWindow:(NSWindow*)window andBrowser:(CefBrowserHostImpl*)browser;
|
||||
- (id)initWithWindow:(NSWindow*)window
|
||||
andBrowser:(AlloyBrowserHostImpl*)browser;
|
||||
@end
|
||||
|
||||
@implementation CefWindowDelegate
|
||||
|
||||
- (id)initWithWindow:(NSWindow*)window andBrowser:(CefBrowserHostImpl*)browser {
|
||||
- (id)initWithWindow:(NSWindow*)window
|
||||
andBrowser:(AlloyBrowserHostImpl*)browser {
|
||||
if (self = [super init]) {
|
||||
window_ = window;
|
||||
browser_ = browser;
|
||||
@@ -150,7 +152,7 @@ CefBrowserPlatformDelegateNativeMac::CefBrowserPlatformDelegateNativeMac(
|
||||
host_window_created_(false) {}
|
||||
|
||||
void CefBrowserPlatformDelegateNativeMac::BrowserDestroyed(
|
||||
CefBrowserHostImpl* browser) {
|
||||
AlloyBrowserHostImpl* browser) {
|
||||
CefBrowserPlatformDelegateNative::BrowserDestroyed(browser);
|
||||
|
||||
if (host_window_created_) {
|
||||
|
@@ -8,7 +8,7 @@
|
||||
#include <wininet.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/native/file_dialog_runner_win.h"
|
||||
#include "libcef/browser/native/javascript_dialog_runner_win.h"
|
||||
@@ -132,7 +132,7 @@ CefBrowserPlatformDelegateNativeWin::CefBrowserPlatformDelegateNativeWin(
|
||||
window_widget_(nullptr) {}
|
||||
|
||||
void CefBrowserPlatformDelegateNativeWin::BrowserDestroyed(
|
||||
CefBrowserHostImpl* browser) {
|
||||
AlloyBrowserHostImpl* browser) {
|
||||
CefBrowserPlatformDelegateNative::BrowserDestroyed(browser);
|
||||
|
||||
if (host_window_created_) {
|
||||
@@ -530,7 +530,7 @@ LRESULT CALLBACK CefBrowserPlatformDelegateNativeWin::WndProc(HWND hwnd,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam) {
|
||||
CefBrowserPlatformDelegateNativeWin* platform_delegate = nullptr;
|
||||
CefBrowserHostImpl* browser = nullptr;
|
||||
AlloyBrowserHostImpl* browser = nullptr;
|
||||
|
||||
if (message != WM_NCCREATE) {
|
||||
platform_delegate = static_cast<CefBrowserPlatformDelegateNativeWin*>(
|
||||
|
@@ -17,7 +17,7 @@ class CefBrowserPlatformDelegateNativeWin
|
||||
SkColor background_color);
|
||||
|
||||
// CefBrowserPlatformDelegate methods:
|
||||
void BrowserDestroyed(CefBrowserHostImpl* browser) override;
|
||||
void BrowserDestroyed(AlloyBrowserHostImpl* browser) override;
|
||||
bool CreateHostWindow() override;
|
||||
void CloseHostWindow() override;
|
||||
CefWindowHandle GetHostWindowHandle() const override;
|
||||
|
@@ -18,7 +18,7 @@ class CefFileDialogRunnerMac : public CefFileDialogRunner {
|
||||
CefFileDialogRunnerMac();
|
||||
|
||||
// CefFileDialogRunner methods:
|
||||
void Run(CefBrowserHostImpl* browser,
|
||||
void Run(AlloyBrowserHostImpl* browser,
|
||||
const FileChooserParams& params,
|
||||
RunFileChooserCallback callback) override;
|
||||
|
||||
|
@@ -8,7 +8,7 @@
|
||||
#import <Cocoa/Cocoa.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/stl_util.h"
|
||||
@@ -231,7 +231,7 @@ void AddFilters(NSPopUpButton* button,
|
||||
|
||||
CefFileDialogRunnerMac::CefFileDialogRunnerMac() : weak_ptr_factory_(this) {}
|
||||
|
||||
void CefFileDialogRunnerMac::Run(CefBrowserHostImpl* browser,
|
||||
void CefFileDialogRunnerMac::Run(AlloyBrowserHostImpl* browser,
|
||||
const FileChooserParams& params,
|
||||
RunFileChooserCallback callback) {
|
||||
callback_ = std::move(callback);
|
||||
|
@@ -11,7 +11,7 @@
|
||||
#include <shlobj.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/stl_util.h"
|
||||
@@ -517,7 +517,7 @@ bool RunSaveFileDialog(const CefFileDialogRunner::FileChooserParams& params,
|
||||
|
||||
CefFileDialogRunnerWin::CefFileDialogRunnerWin() {}
|
||||
|
||||
void CefFileDialogRunnerWin::Run(CefBrowserHostImpl* browser,
|
||||
void CefFileDialogRunnerWin::Run(AlloyBrowserHostImpl* browser,
|
||||
const FileChooserParams& params,
|
||||
RunFileChooserCallback callback) {
|
||||
int filter_index = params.selected_accept_filter;
|
||||
|
@@ -14,7 +14,7 @@ class CefFileDialogRunnerWin : public CefFileDialogRunner {
|
||||
CefFileDialogRunnerWin();
|
||||
|
||||
// CefFileDialogRunner methods:
|
||||
void Run(CefBrowserHostImpl* browser,
|
||||
void Run(AlloyBrowserHostImpl* browser,
|
||||
const FileChooserParams& params,
|
||||
RunFileChooserCallback callback) override;
|
||||
};
|
||||
|
@@ -24,7 +24,7 @@ class CefJavaScriptDialogRunnerMac : public CefJavaScriptDialogRunner {
|
||||
~CefJavaScriptDialogRunnerMac() override;
|
||||
|
||||
// CefJavaScriptDialogRunner methods:
|
||||
void Run(CefBrowserHostImpl* browser,
|
||||
void Run(AlloyBrowserHostImpl* browser,
|
||||
content::JavaScriptDialogType message_type,
|
||||
const base::string16& display_url,
|
||||
const base::string16& message_text,
|
||||
|
@@ -87,7 +87,7 @@ CefJavaScriptDialogRunnerMac::~CefJavaScriptDialogRunnerMac() {
|
||||
}
|
||||
|
||||
void CefJavaScriptDialogRunnerMac::Run(
|
||||
CefBrowserHostImpl* browser,
|
||||
AlloyBrowserHostImpl* browser,
|
||||
content::JavaScriptDialogType message_type,
|
||||
const base::string16& display_url,
|
||||
const base::string16& message_text,
|
||||
|
@@ -5,7 +5,7 @@
|
||||
|
||||
#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 "base/files/file_path.h"
|
||||
@@ -91,7 +91,7 @@ CefJavaScriptDialogRunnerWin::~CefJavaScriptDialogRunnerWin() {
|
||||
}
|
||||
|
||||
void CefJavaScriptDialogRunnerWin::Run(
|
||||
CefBrowserHostImpl* browser,
|
||||
AlloyBrowserHostImpl* browser,
|
||||
content::JavaScriptDialogType message_type,
|
||||
const base::string16& display_url,
|
||||
const base::string16& message_text,
|
||||
|
@@ -17,7 +17,7 @@ class CefJavaScriptDialogRunnerWin : public CefJavaScriptDialogRunner {
|
||||
~CefJavaScriptDialogRunnerWin() override;
|
||||
|
||||
// CefJavaScriptDialogRunner methods:
|
||||
void Run(CefBrowserHostImpl* browser,
|
||||
void Run(AlloyBrowserHostImpl* browser,
|
||||
content::JavaScriptDialogType message_type,
|
||||
const base::string16& display_url,
|
||||
const base::string16& message_text,
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
#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/strings/string_util.h"
|
||||
@@ -13,7 +13,7 @@
|
||||
CefMenuRunnerLinux::CefMenuRunnerLinux() {}
|
||||
|
||||
bool CefMenuRunnerLinux::RunContextMenu(
|
||||
CefBrowserHostImpl* browser,
|
||||
AlloyBrowserHostImpl* browser,
|
||||
CefMenuModelImpl* model,
|
||||
const content::ContextMenuParams& params) {
|
||||
menu_.reset(
|
||||
|
@@ -15,7 +15,7 @@ class CefMenuRunnerLinux : public CefMenuRunner {
|
||||
CefMenuRunnerLinux();
|
||||
|
||||
// CefMenuRunner methods.
|
||||
bool RunContextMenu(CefBrowserHostImpl* browser,
|
||||
bool RunContextMenu(AlloyBrowserHostImpl* browser,
|
||||
CefMenuModelImpl* model,
|
||||
const content::ContextMenuParams& params) override;
|
||||
void CancelContextMenu() override;
|
||||
|
@@ -22,7 +22,7 @@ class CefMenuRunnerMac : public CefMenuRunner {
|
||||
~CefMenuRunnerMac() override;
|
||||
|
||||
// CefMenuRunner methods.
|
||||
bool RunContextMenu(CefBrowserHostImpl* browser,
|
||||
bool RunContextMenu(AlloyBrowserHostImpl* browser,
|
||||
CefMenuModelImpl* model,
|
||||
const content::ContextMenuParams& params) override;
|
||||
void CancelContextMenu() override;
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
#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"
|
||||
#import "base/mac/scoped_sending_event.h"
|
||||
@@ -17,7 +17,7 @@ CefMenuRunnerMac::CefMenuRunnerMac() {}
|
||||
CefMenuRunnerMac::~CefMenuRunnerMac() {}
|
||||
|
||||
bool CefMenuRunnerMac::RunContextMenu(
|
||||
CefBrowserHostImpl* browser,
|
||||
AlloyBrowserHostImpl* browser,
|
||||
CefMenuModelImpl* model,
|
||||
const content::ContextMenuParams& params) {
|
||||
// Create a menu controller based on the model.
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
#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 "base/task/current_thread.h"
|
||||
@@ -13,7 +13,7 @@
|
||||
CefMenuRunnerWin::CefMenuRunnerWin() {}
|
||||
|
||||
bool CefMenuRunnerWin::RunContextMenu(
|
||||
CefBrowserHostImpl* browser,
|
||||
AlloyBrowserHostImpl* browser,
|
||||
CefMenuModelImpl* model,
|
||||
const content::ContextMenuParams& params) {
|
||||
// Create a menu based on the model.
|
||||
|
@@ -15,7 +15,7 @@ class CefMenuRunnerWin : public CefMenuRunner {
|
||||
CefMenuRunnerWin();
|
||||
|
||||
// CefMenuRunner methods.
|
||||
bool RunContextMenu(CefBrowserHostImpl* browser,
|
||||
bool RunContextMenu(AlloyBrowserHostImpl* browser,
|
||||
CefMenuModelImpl* model,
|
||||
const content::ContextMenuParams& params) override;
|
||||
|
||||
|
@@ -47,7 +47,7 @@ void CefWindowDelegateView::Init(gfx::AcceleratedWidget parent_widget,
|
||||
// Tell Aura not to draw the window frame on resize.
|
||||
params.remove_standard_frame = true;
|
||||
// Cause WidgetDelegate::CanActivate to return true. See comments in
|
||||
// CefBrowserHostImpl::PlatformSetFocus.
|
||||
// AlloyBrowserHostImpl::PlatformSetFocus.
|
||||
params.activatable = views::Widget::InitParams::ACTIVATABLE_YES;
|
||||
|
||||
params.z_order = always_on_top_ ? ui::ZOrderLevel::kFloatingWindow
|
||||
|
@@ -92,7 +92,7 @@ CEF_EXPORT XDisplay* cef_get_xdisplay() {
|
||||
return gfx::GetXDisplay();
|
||||
}
|
||||
|
||||
CefWindowX11::CefWindowX11(CefRefPtr<CefBrowserHostImpl> browser,
|
||||
CefWindowX11::CefWindowX11(CefRefPtr<AlloyBrowserHostImpl> browser,
|
||||
::Window parent_xwindow,
|
||||
const gfx::Rect& bounds,
|
||||
const std::string& title)
|
||||
|
@@ -12,7 +12,7 @@ typedef unsigned long Window;
|
||||
struct _XDisplay;
|
||||
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 "ui/events/platform/platform_event_dispatcher.h"
|
||||
@@ -29,7 +29,7 @@ class DesktopWindowTreeHostLinux;
|
||||
class CefWindowX11 : public ui::PlatformEventDispatcher,
|
||||
public ui::XEventDispatcher {
|
||||
public:
|
||||
CefWindowX11(CefRefPtr<CefBrowserHostImpl> browser,
|
||||
CefWindowX11(CefRefPtr<AlloyBrowserHostImpl> browser,
|
||||
::Window parent_xwindow,
|
||||
const gfx::Rect& bounds,
|
||||
const std::string& title);
|
||||
@@ -69,7 +69,7 @@ class CefWindowX11 : public ui::PlatformEventDispatcher,
|
||||
bool IsTargetedBy(const x11::Event& x11_event) const;
|
||||
void ProcessXEvent(x11::Event* xev);
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl> browser_;
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser_;
|
||||
|
||||
// The display and the native X window hosting the root window.
|
||||
::Display* xdisplay_;
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
#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/thread_util.h"
|
||||
|
||||
@@ -67,7 +67,7 @@ class AuthCallbackImpl : public CefAuthCallback {
|
||||
};
|
||||
|
||||
void RunCallbackOnIOThread(
|
||||
CefRefPtr<CefBrowserHostImpl> browser,
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser,
|
||||
base::Optional<CefBrowserURLRequest::RequestInfo> url_request_info,
|
||||
const net::AuthChallengeInfo& auth_info,
|
||||
const GURL& origin_url,
|
||||
@@ -119,9 +119,9 @@ LoginDelegate::LoginDelegate(const net::AuthChallengeInfo& auth_info,
|
||||
CEF_REQUIRE_UIT();
|
||||
|
||||
// May be nullptr for requests originating from CefURLRequest.
|
||||
CefRefPtr<CefBrowserHostImpl> browser;
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser;
|
||||
if (web_contents) {
|
||||
browser = CefBrowserHostImpl::GetBrowserForContents(web_contents);
|
||||
browser = AlloyBrowserHostImpl::GetBrowserForContents(web_contents);
|
||||
}
|
||||
|
||||
// |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 content::GlobalRequestID& request_id,
|
||||
const GURL& origin_url) {
|
||||
|
@@ -17,7 +17,7 @@ struct GlobalRequestID;
|
||||
class WebContents;
|
||||
} // namespace content
|
||||
|
||||
class CefBrowserHostImpl;
|
||||
class AlloyBrowserHostImpl;
|
||||
class GURL;
|
||||
|
||||
namespace net_service {
|
||||
@@ -36,7 +36,7 @@ class LoginDelegate : public content::LoginDelegate {
|
||||
void Cancel();
|
||||
|
||||
private:
|
||||
void Start(CefRefPtr<CefBrowserHostImpl> browser,
|
||||
void Start(CefRefPtr<AlloyBrowserHostImpl> browser,
|
||||
const net::AuthChallengeInfo& auth_info,
|
||||
const content::GlobalRequestID& request_id,
|
||||
const GURL& origin_url);
|
||||
|
@@ -6,7 +6,7 @@
|
||||
|
||||
#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/osr/osr_accessibility_util.h"
|
||||
#include "libcef/browser/osr/render_widget_host_view_osr.h"
|
||||
@@ -60,7 +60,7 @@ void CefBrowserPlatformDelegateOsr::RenderViewCreated(
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateOsr::BrowserCreated(
|
||||
CefBrowserHostImpl* browser) {
|
||||
AlloyBrowserHostImpl* browser) {
|
||||
CefBrowserPlatformDelegateAlloy::BrowserCreated(browser);
|
||||
|
||||
if (browser->IsPopup()) {
|
||||
@@ -92,7 +92,7 @@ void CefBrowserPlatformDelegateOsr::NotifyBrowserDestroyed() {
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateOsr::BrowserDestroyed(
|
||||
CefBrowserHostImpl* browser) {
|
||||
AlloyBrowserHostImpl* browser) {
|
||||
CefBrowserPlatformDelegateAlloy::BrowserDestroyed(browser);
|
||||
|
||||
view_osr_ = nullptr;
|
||||
|
@@ -27,9 +27,9 @@ class CefBrowserPlatformDelegateOsr
|
||||
void WebContentsCreated(content::WebContents* web_contents,
|
||||
bool owned) override;
|
||||
void RenderViewCreated(content::RenderViewHost* render_view_host) override;
|
||||
void BrowserCreated(CefBrowserHostImpl* browser) override;
|
||||
void BrowserCreated(AlloyBrowserHostImpl* browser) override;
|
||||
void NotifyBrowserDestroyed() override;
|
||||
void BrowserDestroyed(CefBrowserHostImpl* browser) override;
|
||||
void BrowserDestroyed(AlloyBrowserHostImpl* browser) override;
|
||||
SkColor GetBackgroundColor() const override;
|
||||
void WasResized() override;
|
||||
void SendKeyEvent(const CefKeyEvent& event) override;
|
||||
|
@@ -6,8 +6,6 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "libcef/browser/browser_host_impl.h"
|
||||
|
||||
CefBrowserPlatformDelegateOsrLinux::CefBrowserPlatformDelegateOsrLinux(
|
||||
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate,
|
||||
bool use_external_begin_frame)
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "libcef/browser/browser_host_impl.h"
|
||||
#include "libcef/browser/osr/render_widget_host_view_osr.h"
|
||||
|
||||
CefBrowserPlatformDelegateOsrMac::CefBrowserPlatformDelegateOsrMac(
|
||||
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate)
|
||||
: CefBrowserPlatformDelegateOsr(std::move(native_delegate),
|
||||
|
@@ -6,8 +6,6 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "libcef/browser/browser_host_impl.h"
|
||||
|
||||
CefBrowserPlatformDelegateOsrWin::CefBrowserPlatformDelegateOsrWin(
|
||||
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate,
|
||||
bool use_shared_texture,
|
||||
|
@@ -6,7 +6,6 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "libcef/browser/browser_host_impl.h"
|
||||
#include "libcef/browser/osr/render_widget_host_view_osr.h"
|
||||
|
||||
#include "base/memory/shared_memory_mapping.h"
|
||||
|
@@ -9,7 +9,7 @@
|
||||
|
||||
#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/synthetic_gesture_target_osr.h"
|
||||
#include "libcef/browser/osr/video_consumer_osr.h"
|
||||
@@ -146,7 +146,7 @@ ui::LatencyInfo CreateLatencyInfo(const blink::WebInputEvent& event) {
|
||||
return latency_info;
|
||||
}
|
||||
|
||||
gfx::Rect GetViewBounds(CefBrowserHostImpl* browser) {
|
||||
gfx::Rect GetViewBounds(AlloyBrowserHostImpl* browser) {
|
||||
if (!browser)
|
||||
return gfx::Rect();
|
||||
|
||||
@@ -162,7 +162,7 @@ gfx::Rect GetViewBounds(CefBrowserHostImpl* browser) {
|
||||
return gfx::Rect(rc.x, rc.y, rc.width, rc.height);
|
||||
}
|
||||
|
||||
float GetDeviceScaleFactor(CefBrowserHostImpl* browser) {
|
||||
float GetDeviceScaleFactor(AlloyBrowserHostImpl* browser) {
|
||||
if (!browser)
|
||||
return kDefaultScaleFactor;
|
||||
|
||||
@@ -231,8 +231,8 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
|
||||
browser_impl_ = parent_host_view_->browser_impl();
|
||||
DCHECK(browser_impl_);
|
||||
} else if (content::RenderViewHost::From(render_widget_host_)) {
|
||||
// CefBrowserHostImpl might not be created at this time for popups.
|
||||
browser_impl_ = CefBrowserHostImpl::GetBrowserForHost(
|
||||
// AlloyBrowserHostImpl might not be created at this time for popups.
|
||||
browser_impl_ = AlloyBrowserHostImpl::GetBrowserForHost(
|
||||
content::RenderViewHost::From(render_widget_host_));
|
||||
}
|
||||
|
||||
@@ -1517,7 +1517,7 @@ ui::Layer* CefRenderWidgetHostViewOSR::GetRootLayer() const {
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::SetFrameRate() {
|
||||
CefRefPtr<CefBrowserHostImpl> browser;
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser;
|
||||
if (parent_host_view_) {
|
||||
// Use the same frame rate as the embedding browser.
|
||||
browser = parent_host_view_->browser_impl_;
|
||||
|
@@ -14,7 +14,7 @@
|
||||
#include "include/cef_base.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/motion_event_osr.h"
|
||||
|
||||
@@ -242,8 +242,8 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
||||
void ImeFinishComposingText(bool keep_selection);
|
||||
void ImeCancelComposition() override;
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl> browser_impl() const { return browser_impl_; }
|
||||
void set_browser_impl(CefRefPtr<CefBrowserHostImpl> browser) {
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser_impl() const { return browser_impl_; }
|
||||
void set_browser_impl(CefRefPtr<AlloyBrowserHostImpl> browser) {
|
||||
browser_impl_ = browser;
|
||||
}
|
||||
|
||||
@@ -378,7 +378,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
||||
CefRenderWidgetHostViewOSR* child_host_view_ = nullptr;
|
||||
std::set<CefRenderWidgetHostViewOSR*> guest_host_views_;
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl> browser_impl_;
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser_impl_;
|
||||
|
||||
bool is_showing_ = false;
|
||||
bool is_destroyed_ = false;
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include "libcef/browser/browser_host_impl.h"
|
||||
#include "libcef/common/app_manager.h"
|
||||
|
||||
#include "ui/resources/grit/ui_unscaled_resources.h"
|
||||
|
@@ -4,7 +4,6 @@
|
||||
|
||||
#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 "media/base/video_frame_metadata.h"
|
||||
|
@@ -5,7 +5,7 @@
|
||||
|
||||
#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/common/drag_data_impl.h"
|
||||
|
||||
@@ -151,7 +151,7 @@ void CefWebContentsViewOSR::StartDragging(
|
||||
const gfx::Vector2d& image_offset,
|
||||
const content::DragEventSourceInfo& event_info,
|
||||
content::RenderWidgetHostImpl* source_rwh) {
|
||||
CefRefPtr<CefBrowserHostImpl> browser = GetBrowser();
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser = GetBrowser();
|
||||
if (browser.get()) {
|
||||
browser->StartDragging(drop_data, allowed_ops, image, image_offset,
|
||||
event_info, source_rwh);
|
||||
@@ -163,7 +163,7 @@ void CefWebContentsViewOSR::StartDragging(
|
||||
|
||||
void CefWebContentsViewOSR::UpdateDragCursor(
|
||||
blink::WebDragOperation operation) {
|
||||
CefRefPtr<CefBrowserHostImpl> browser = GetBrowser();
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser = GetBrowser();
|
||||
if (browser.get())
|
||||
browser->UpdateDragCursor(operation);
|
||||
}
|
||||
@@ -176,7 +176,7 @@ CefRenderWidgetHostViewOSR* CefWebContentsViewOSR::GetView() const {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CefBrowserHostImpl* CefWebContentsViewOSR::GetBrowser() const {
|
||||
AlloyBrowserHostImpl* CefWebContentsViewOSR::GetBrowser() const {
|
||||
CefRenderWidgetHostViewOSR* view = GetView();
|
||||
if (view)
|
||||
return view->browser_impl().get();
|
||||
|
@@ -16,7 +16,7 @@ class WebContents;
|
||||
class WebContentsViewDelegate;
|
||||
} // namespace content
|
||||
|
||||
class CefBrowserHostImpl;
|
||||
class AlloyBrowserHostImpl;
|
||||
class CefRenderWidgetHostViewOSR;
|
||||
|
||||
// An implementation of WebContentsView for off-screen rendering.
|
||||
@@ -76,7 +76,7 @@ class CefWebContentsViewOSR : public content::WebContentsView,
|
||||
|
||||
private:
|
||||
CefRenderWidgetHostViewOSR* GetView() const;
|
||||
CefBrowserHostImpl* GetBrowser() const;
|
||||
AlloyBrowserHostImpl* GetBrowser() const;
|
||||
|
||||
const SkColor background_color_;
|
||||
const bool use_shared_texture_;
|
||||
|
@@ -6,7 +6,7 @@
|
||||
|
||||
#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/extensions/browser_extensions_util.h"
|
||||
#include "libcef/common/cef_switches.h"
|
||||
@@ -354,7 +354,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
|
||||
void PopulateWebPreferences(content::RenderViewHost* rvh,
|
||||
content::WebPreferences& web) {
|
||||
REQUIRE_ALLOY_RUNTIME();
|
||||
CefRefPtr<CefBrowserHostImpl> browser = static_cast<CefBrowserHostImpl*>(
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser = static_cast<AlloyBrowserHostImpl*>(
|
||||
extensions::GetOwnerBrowserForHost(rvh, nullptr).get());
|
||||
|
||||
// Set defaults for preferences that are not handled by PrefService.
|
||||
|
@@ -20,9 +20,9 @@ class CefRequestContextHandlerMap {
|
||||
~CefRequestContextHandlerMap();
|
||||
|
||||
// Keep track of handlers associated with specific frames. This information
|
||||
// originates from frame create/delete notifications in CefBrowserHostImpl or
|
||||
// CefMimeHandlerViewGuestDelegate which are forwarded via
|
||||
// CefRequestContextImpl and CefBrowserContext.
|
||||
// originates from frame create/delete notifications in
|
||||
// CefBrowserContentsDelegate or CefMimeHandlerViewGuestDelegate which are
|
||||
// forwarded via CefRequestContextImpl and CefBrowserContext.
|
||||
void AddHandler(int render_process_id,
|
||||
int render_frame_id,
|
||||
int frame_tree_node_id,
|
||||
|
@@ -81,7 +81,7 @@ class CefRequestContextImpl : public CefRequestContext {
|
||||
|
||||
const CefRequestContextSettings& settings() const { return config_.settings; }
|
||||
|
||||
// Called from CefBrowserHostImpl::RenderFrameCreated or
|
||||
// Called from CefBrowserContentsDelegate::RenderFrameCreated or
|
||||
// CefMimeHandlerViewGuestDelegate::OnGuestAttached when a render frame is
|
||||
// created.
|
||||
void OnRenderFrameCreated(int render_process_id,
|
||||
@@ -90,7 +90,7 @@ class CefRequestContextImpl : public CefRequestContext {
|
||||
bool is_main_frame,
|
||||
bool is_guest_view);
|
||||
|
||||
// Called from CefBrowserHostImpl::FrameDeleted or
|
||||
// Called from CefBrowserContentsDelegate::RenderFrameDeleted or
|
||||
// CefMimeHandlerViewGuestDelegate::OnGuestDetached when a render frame is
|
||||
// deleted.
|
||||
void OnRenderFrameDeleted(int render_process_id,
|
||||
|
@@ -7,7 +7,7 @@
|
||||
#include <utility>
|
||||
|
||||
#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/menu_runner_views.h"
|
||||
|
||||
@@ -80,7 +80,7 @@ void CefBrowserPlatformDelegateViews::WebContentsDestroyed(
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateViews::BrowserCreated(
|
||||
CefBrowserHostImpl* browser) {
|
||||
AlloyBrowserHostImpl* browser) {
|
||||
CefBrowserPlatformDelegateAlloy::BrowserCreated(browser);
|
||||
|
||||
native_delegate_->BrowserCreated(browser);
|
||||
@@ -102,7 +102,7 @@ void CefBrowserPlatformDelegateViews::NotifyBrowserDestroyed() {
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateViews::BrowserDestroyed(
|
||||
CefBrowserHostImpl* browser) {
|
||||
AlloyBrowserHostImpl* browser) {
|
||||
CefBrowserPlatformDelegateAlloy::BrowserDestroyed(browser);
|
||||
|
||||
browser_view_->BrowserDestroyed(browser);
|
||||
@@ -161,7 +161,7 @@ void CefBrowserPlatformDelegateViews::PopupWebContentsCreated(
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateViews::PopupBrowserCreated(
|
||||
CefBrowserHostImpl* new_browser,
|
||||
AlloyBrowserHostImpl* new_browser,
|
||||
bool is_devtools) {
|
||||
CefRefPtr<CefBrowserView> new_browser_view =
|
||||
CefBrowserView::GetForBrowser(new_browser);
|
||||
|
@@ -24,10 +24,10 @@ class CefBrowserPlatformDelegateViews
|
||||
void WebContentsCreated(content::WebContents* web_contents,
|
||||
bool owned) override;
|
||||
void WebContentsDestroyed(content::WebContents* web_contents) override;
|
||||
void BrowserCreated(CefBrowserHostImpl* browser) override;
|
||||
void BrowserCreated(AlloyBrowserHostImpl* browser) override;
|
||||
void NotifyBrowserCreated() override;
|
||||
void NotifyBrowserDestroyed() override;
|
||||
void BrowserDestroyed(CefBrowserHostImpl* browser) override;
|
||||
void BrowserDestroyed(AlloyBrowserHostImpl* browser) override;
|
||||
bool CreateHostWindow() override;
|
||||
void CloseHostWindow() override;
|
||||
CefWindowHandle GetHostWindowHandle() const override;
|
||||
@@ -39,7 +39,7 @@ class CefBrowserPlatformDelegateViews
|
||||
content::WebContents* new_web_contents,
|
||||
CefBrowserPlatformDelegate* new_platform_delegate,
|
||||
bool is_devtools) override;
|
||||
void PopupBrowserCreated(CefBrowserHostImpl* new_browser,
|
||||
void PopupBrowserCreated(AlloyBrowserHostImpl* new_browser,
|
||||
bool is_devtools) override;
|
||||
SkColor GetBackgroundColor() const override;
|
||||
void WasResized() override;
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
#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/context.h"
|
||||
#include "libcef/browser/thread_util.h"
|
||||
@@ -30,8 +30,8 @@ CefRefPtr<CefBrowserView> CefBrowserView::CreateBrowserView(
|
||||
CefRefPtr<CefBrowserView> CefBrowserView::GetForBrowser(
|
||||
CefRefPtr<CefBrowser> browser) {
|
||||
CEF_REQUIRE_UIT_RETURN(nullptr);
|
||||
CefBrowserHostImpl* browser_impl =
|
||||
static_cast<CefBrowserHostImpl*>(browser.get());
|
||||
AlloyBrowserHostImpl* browser_impl =
|
||||
static_cast<AlloyBrowserHostImpl*>(browser.get());
|
||||
if (browser_impl && browser_impl->IsViewsHosted())
|
||||
return browser_impl->GetBrowserView();
|
||||
return nullptr;
|
||||
@@ -75,13 +75,13 @@ void CefBrowserViewImpl::WebContentsCreated(
|
||||
}
|
||||
|
||||
void CefBrowserViewImpl::BrowserCreated(
|
||||
CefBrowserHostImpl* browser,
|
||||
AlloyBrowserHostImpl* browser,
|
||||
base::RepeatingClosure on_bounds_changed) {
|
||||
browser_ = browser;
|
||||
on_bounds_changed_ = on_bounds_changed;
|
||||
}
|
||||
|
||||
void CefBrowserViewImpl::BrowserDestroyed(CefBrowserHostImpl* browser) {
|
||||
void CefBrowserViewImpl::BrowserDestroyed(AlloyBrowserHostImpl* browser) {
|
||||
DCHECK_EQ(browser, browser_);
|
||||
browser_ = nullptr;
|
||||
|
||||
@@ -145,7 +145,7 @@ void CefBrowserViewImpl::Detach() {
|
||||
if (browser_) {
|
||||
// |browser_| will disappear when WindowDestroyed() indirectly calls
|
||||
// BrowserDestroyed() so keep a reference.
|
||||
CefRefPtr<CefBrowserHostImpl> browser = browser_;
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser = browser_;
|
||||
|
||||
// Force the browser to be destroyed.
|
||||
browser->WindowDestroyed();
|
||||
@@ -165,7 +165,7 @@ void CefBrowserViewImpl::OnBrowserViewAdded() {
|
||||
// hierarchy.
|
||||
pending_browser_create_params_->browser_view = this;
|
||||
|
||||
CefBrowserHostImpl::Create(*pending_browser_create_params_);
|
||||
AlloyBrowserHostImpl::Create(*pending_browser_create_params_);
|
||||
DCHECK(browser_);
|
||||
|
||||
pending_browser_create_params_.reset(nullptr);
|
||||
|
@@ -10,7 +10,7 @@
|
||||
#include "include/views/cef_browser_view.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/view_impl.h"
|
||||
|
||||
@@ -44,9 +44,9 @@ class CefBrowserViewImpl : public CefViewImpl<CefBrowserViewView,
|
||||
|
||||
// Called from CefBrowserPlatformDelegateViews.
|
||||
void WebContentsCreated(content::WebContents* web_contents);
|
||||
void BrowserCreated(CefBrowserHostImpl* browser,
|
||||
void BrowserCreated(AlloyBrowserHostImpl* browser,
|
||||
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
|
||||
// content and the browser client.
|
||||
@@ -98,7 +98,7 @@ class CefBrowserViewImpl : public CefViewImpl<CefBrowserViewView,
|
||||
std::unique_ptr<CefBrowserHostBase::CreateParams>
|
||||
pending_browser_create_params_;
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl> browser_;
|
||||
CefRefPtr<AlloyBrowserHostImpl> browser_;
|
||||
|
||||
views::UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_;
|
||||
bool ignore_next_char_event_ = false;
|
||||
|
@@ -4,14 +4,14 @@
|
||||
|
||||
#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"
|
||||
|
||||
CefMenuRunnerViews::CefMenuRunnerViews(CefBrowserViewImpl* browser_view)
|
||||
: browser_view_(browser_view) {}
|
||||
|
||||
bool CefMenuRunnerViews::RunContextMenu(
|
||||
CefBrowserHostImpl* browser,
|
||||
AlloyBrowserHostImpl* browser,
|
||||
CefMenuModelImpl* model,
|
||||
const content::ContextMenuParams& params) {
|
||||
CefRefPtr<CefWindow> window = browser_view_->GetWindow();
|
||||
|
@@ -16,7 +16,7 @@ class CefMenuRunnerViews : public CefMenuRunner {
|
||||
explicit CefMenuRunnerViews(CefBrowserViewImpl* browser_view);
|
||||
|
||||
// CefMenuRunner methods.
|
||||
bool RunContextMenu(CefBrowserHostImpl* browser,
|
||||
bool RunContextMenu(AlloyBrowserHostImpl* browser,
|
||||
CefMenuModelImpl* model,
|
||||
const content::ContextMenuParams& params) override;
|
||||
void CancelContextMenu() override;
|
||||
|
@@ -114,7 +114,7 @@ class CefRequestImpl : public CefRequest {
|
||||
blink::WebURLRequest& request);
|
||||
|
||||
// Populate the CefNavigateParams object from this object.
|
||||
// Called from CefBrowserHostImpl::LoadRequest().
|
||||
// Called from CefFrameHostImpl::LoadRequest().
|
||||
void Get(CefNavigateParams& params) const;
|
||||
|
||||
void SetReadOnly(bool read_only);
|
||||
|
@@ -47,7 +47,7 @@ index c7bd97a32af1..311f2c52af8d 100644
|
||||
"views/toolbar/toolbar_account_icon_container_view.h",
|
||||
"views/toolbar/toolbar_action_view.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
|
||||
@@ -21,6 +21,7 @@
|
||||
@@ -63,7 +63,7 @@ index f27414c41891..0e6663680e80 100644
|
||||
#include "ui/shell_dialogs/select_file_dialog.h"
|
||||
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+#include "cef/libcef/browser/browser_host_impl.h"
|
||||
+#include "cef/libcef/browser/alloy/alloy_browser_host_impl.h"
|
||||
+#endif
|
||||
+
|
||||
#if defined(OS_ANDROID)
|
||||
@@ -121,8 +121,8 @@ index f27414c41891..0e6663680e80 100644
|
||||
+
|
||||
+void NetExportMessageHandler::ShowCefSaveAsDialog(
|
||||
+ content::WebContents* web_contents) {
|
||||
+ CefRefPtr<CefBrowserHostImpl> cef_browser =
|
||||
+ CefBrowserHostImpl::GetBrowserForContents(web_contents);
|
||||
+ CefRefPtr<AlloyBrowserHostImpl> cef_browser =
|
||||
+ AlloyBrowserHostImpl::GetBrowserForContents(web_contents);
|
||||
+ if (!cef_browser)
|
||||
+ return;
|
||||
+
|
||||
|
@@ -112,80 +112,77 @@ index b59728f623e3..6fd443962836 100644
|
||||
|
||||
ConstrainedWebDialogUI::~ConstrainedWebDialogUI() {
|
||||
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
|
||||
@@ -184,8 +184,10 @@ PdfPrinterHandler::PdfPrinterHandler(
|
||||
sticky_settings_(sticky_settings) {}
|
||||
@@ -20,6 +20,7 @@
|
||||
#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 (select_file_dialog_.get())
|
||||
select_file_dialog_->ListenerDestroyed();
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+#include "cef/libcef/browser/alloy/alloy_browser_host_impl.h"
|
||||
+#endif
|
||||
}
|
||||
+
|
||||
namespace printing {
|
||||
|
||||
void PdfPrinterHandler::Reset() {
|
||||
@@ -232,12 +234,14 @@ void PdfPrinterHandler::StartPrint(
|
||||
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,
|
||||
namespace {
|
||||
@@ -380,10 +385,27 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename,
|
||||
// If the directory is empty there is no reason to create it or use the
|
||||
// default location.
|
||||
if (path.empty()) {
|
||||
+#if !BUILDFLAG(ENABLE_CEF)
|
||||
OnDirectorySelected(default_filename, path);
|
||||
+#else
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+ if (cef::IsAlloyRuntimeEnabled()) {
|
||||
+ ShowCefSaveAsDialog(initiator, default_filename, path);
|
||||
+ return;
|
||||
+ }
|
||||
+#endif
|
||||
OnDirectorySelected(default_filename, path);
|
||||
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(
|
||||
FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT},
|
||||
base::BindOnce(&SelectSaveDirectory, path, default_path),
|
||||
+#if !BUILDFLAG(ENABLE_CEF)
|
||||
base::BindOnce(&PdfPrinterHandler::OnDirectorySelected,
|
||||
weak_ptr_factory_.GetWeakPtr(), default_filename));
|
||||
+#else
|
||||
+ base::BindOnce(&PdfPrinterHandler::ShowCefSaveAsDialog,
|
||||
+ weak_ptr_factory_.GetWeakPtr(), initiator,
|
||||
+ default_filename));
|
||||
+#endif
|
||||
- base::BindOnce(&PdfPrinterHandler::OnDirectorySelected,
|
||||
- weak_ptr_factory_.GetWeakPtr(), default_filename));
|
||||
+ std::move(callback));
|
||||
}
|
||||
|
||||
void PdfPrinterHandler::PostPrintToPdfTask() {
|
||||
@@ -408,6 +422,7 @@ void PdfPrinterHandler::OnGotUniqueFileName(const base::FilePath& path) {
|
||||
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(),
|
||||
@@ -433,6 +454,40 @@ void PdfPrinterHandler::OnDirectorySelected(const base::FilePath& filename,
|
||||
platform_util::GetTopLevel(preview_web_contents_->GetNativeView()), NULL);
|
||||
}
|
||||
+#else
|
||||
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+
|
||||
+void PdfPrinterHandler::ShowCefSaveAsDialog(content::WebContents* initiator,
|
||||
+ const base::FilePath& filename,
|
||||
+ const base::FilePath& directory) {
|
||||
+ CefRefPtr<CefBrowserHostImpl> cef_browser =
|
||||
+ CefBrowserHostImpl::GetBrowserForContents(initiator);
|
||||
+ CefRefPtr<AlloyBrowserHostImpl> cef_browser =
|
||||
+ AlloyBrowserHostImpl::GetBrowserForContents(initiator);
|
||||
+ if (!cef_browser)
|
||||
+ return;
|
||||
+
|
||||
@@ -210,15 +207,17 @@ index bb362bbd321e..ba5a9336ec6a 100644
|
||||
+ FileSelectionCanceled(nullptr);
|
||||
+ }
|
||||
+}
|
||||
+#endif
|
||||
|
||||
+
|
||||
+#endif // BUILDFLAG(ENABLE_CEF)
|
||||
+
|
||||
base::FilePath PdfPrinterHandler::GetSaveLocation() const {
|
||||
#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
|
||||
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
|
||||
@@ -11,9 +11,14 @@
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "base/memory/weak_ptr.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 "ui/shell_dialogs/select_file_dialog.h"
|
||||
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+#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|.
|
||||
@@ -88,6 +89,15 @@ class PdfPrinterHandler : public PrinterHandler,
|
||||
void OnDirectorySelected(const base::FilePath& filename,
|
||||
const base::FilePath& directory);
|
||||
+#else
|
||||
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+ void ShowCefSaveAsDialog(content::WebContents* initiator,
|
||||
+ const base::FilePath& filename,
|
||||
+ const base::FilePath& directory);
|
||||
@@ -259,9 +237,10 @@ index 26954aeae08f..025ecfa9aceb 100644
|
||||
+ void SaveAsDialogDismissed(int selected_accept_filter,
|
||||
+ const std::vector<base::FilePath>& file_paths);
|
||||
+#endif
|
||||
|
||||
+
|
||||
// Return save location as the Drive mount or fetch from Download Preferences.
|
||||
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
|
||||
index ba451b6c854d..0f062e69fd47 100644
|
||||
--- chrome/browser/ui/webui/print_preview/print_preview_handler.cc
|
||||
|
Reference in New Issue
Block a user