diff --git a/BUILD.gn b/BUILD.gn index a2978189f..ad234fe18 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -620,8 +620,6 @@ static_library("libcef_static") { "libcef/browser/osr/web_contents_view_osr.cc", "libcef/browser/osr/web_contents_view_osr.h", "libcef/browser/path_util_impl.cc", - "libcef/browser/plugins/plugin_service_filter.cc", - "libcef/browser/plugins/plugin_service_filter.h", "libcef/browser/prefs/browser_prefs.cc", "libcef/browser/prefs/browser_prefs.h", "libcef/browser/prefs/pref_store.cc", diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index 3595dda79..c0aeacf56 100644 --- a/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -7,5 +7,5 @@ # https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding { - 'chromium_checkout': 'refs/tags/96.0.4664.0' + 'chromium_checkout': 'refs/tags/97.0.4692.0' } diff --git a/cef_paths2.gypi b/cef_paths2.gypi index 251a05471..4b801b968 100644 --- a/cef_paths2.gypi +++ b/cef_paths2.gypi @@ -480,7 +480,7 @@ 'tests/ceftests/osr_accessibility_unittest.cc', 'tests/ceftests/osr_display_unittest.cc', 'tests/ceftests/parser_unittest.cc', - 'tests/ceftests/plugin_unittest.cc', + 'tests/ceftests/pdf_viewer_unittest.cc', 'tests/ceftests/preference_unittest.cc', 'tests/ceftests/print_unittest.cc', 'tests/ceftests/process_message_unittest.cc', @@ -563,7 +563,7 @@ 'tests/ceftests/frame_unittest.cc', 'tests/ceftests/message_router_unittest.cc', 'tests/ceftests/navigation_unittest.cc', - 'tests/ceftests/plugin_unittest.cc', + 'tests/ceftests/pdf_viewer_unittest.cc', 'tests/ceftests/preference_unittest.cc', 'tests/ceftests/process_message_unittest.cc', 'tests/ceftests/request_handler_unittest.cc', diff --git a/include/capi/cef_request_context_capi.h b/include/capi/cef_request_context_capi.h index 9871a214d..fd820fa4f 100644 --- a/include/capi/cef_request_context_capi.h +++ b/include/capi/cef_request_context_capi.h @@ -33,7 +33,7 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // -// $hash=2e42334fc22050e207e5a0af6fe290a592e4105f$ +// $hash=77e2da51f7af8b4fbb317d8cdab5e5e7c9d3300d$ // #ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_ @@ -165,17 +165,6 @@ typedef struct _cef_request_context_t { int(CEF_CALLBACK* clear_scheme_handler_factories)( struct _cef_request_context_t* self); - /// - // Tells all renderer processes associated with this context to throw away - // their plugin list cache. If |reload_pages| is true (1) they will also - // reload all pages with plugins. - // cef_request_context_handler_t::OnBeforePluginLoad may be called to rebuild - // the plugin list cache. - /// - void(CEF_CALLBACK* purge_plugin_list_cache)( - struct _cef_request_context_t* self, - int reload_pages); - /// // Returns true (1) if a preference with the specified |name| exists. This // function must be called on the browser process UI thread. diff --git a/include/capi/cef_request_context_handler_capi.h b/include/capi/cef_request_context_handler_capi.h index c14f67286..e6a53d610 100644 --- a/include/capi/cef_request_context_handler_capi.h +++ b/include/capi/cef_request_context_handler_capi.h @@ -33,7 +33,7 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // -// $hash=fa148db8a0ecd79966814086fb92e439687be701$ +// $hash=8fa983ddbdb8ad3199a0e495e0b6928b37128913$ // #ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_ @@ -70,34 +70,6 @@ typedef struct _cef_request_context_handler_t { struct _cef_request_context_handler_t* self, struct _cef_request_context_t* request_context); - /// - // Called on multiple browser process threads before a plugin instance is - // loaded. |mime_type| is the mime type of the plugin that will be loaded. - // |plugin_url| is the content URL that the plugin will load and may be NULL. - // |is_main_frame| will be true (1) if the plugin is being loaded in the main - // (top-level) frame, |top_origin_url| is the URL for the top-level frame that - // contains the plugin when loading a specific plugin instance or NULL when - // building the initial list of enabled plugins for 'navigator.plugins' - // JavaScript state. |plugin_info| includes additional information about the - // plugin that will be loaded. |plugin_policy| is the recommended policy. - // Modify |plugin_policy| and return true (1) to change the policy. Return - // false (0) to use the recommended policy. The default plugin policy can be - // set at runtime using the `--plugin-policy=[allow|detect|block]` command- - // line flag. Decisions to mark a plugin as disabled by setting - // |plugin_policy| to PLUGIN_POLICY_DISABLED may be cached when - // |top_origin_url| is NULL. To purge the plugin list cache and potentially - // trigger new calls to this function call - // cef_request_context_t::PurgePluginListCache. - /// - int(CEF_CALLBACK* on_before_plugin_load)( - struct _cef_request_context_handler_t* self, - const cef_string_t* mime_type, - const cef_string_t* plugin_url, - int is_main_frame, - const cef_string_t* top_origin_url, - struct _cef_web_plugin_info_t* plugin_info, - cef_plugin_policy_t* plugin_policy); - /// // Called on the browser process IO thread before a resource request is // initiated. The |browser| and |frame| values represent the source of the diff --git a/include/cef_api_hash.h b/include/cef_api_hash.h index 0084708f5..611a4164a 100644 --- a/include/cef_api_hash.h +++ b/include/cef_api_hash.h @@ -42,13 +42,13 @@ // way that may cause binary incompatibility with other builds. The universal // hash value will change if any platform is affected whereas the platform hash // values will change only if that particular platform is affected. -#define CEF_API_HASH_UNIVERSAL "21ac25aebdb49a8e8088c6fbee802b04fd07b501" +#define CEF_API_HASH_UNIVERSAL "6f6a9c0f3b420cd3120cf4f5924cbc91f5095abd" #if defined(OS_WIN) -#define CEF_API_HASH_PLATFORM "1d81ccb5ba2f6d658abde2faeb490c8f7f6a60fe" +#define CEF_API_HASH_PLATFORM "5835e67ed251fec96837b475df44248a286e422f" #elif defined(OS_MAC) -#define CEF_API_HASH_PLATFORM "d6bd1ab64a160962ee0306625da5dd2a0cae8b31" +#define CEF_API_HASH_PLATFORM "b8187d9f99b028d767dfd6a40490190c25a3d901" #elif defined(OS_LINUX) -#define CEF_API_HASH_PLATFORM "0b5227787444955a548b7544b2cdcda95a354506" +#define CEF_API_HASH_PLATFORM "d7199dfd396052e1517e55f18ea75d3d61336538" #endif #ifdef __cplusplus diff --git a/include/cef_request_context.h b/include/cef_request_context.h index ca1a55e5f..57cf29895 100644 --- a/include/cef_request_context.h +++ b/include/cef_request_context.h @@ -179,15 +179,6 @@ class CefRequestContext : public virtual CefBaseRefCounted { /*--cef()--*/ virtual bool ClearSchemeHandlerFactories() = 0; - /// - // Tells all renderer processes associated with this context to throw away - // their plugin list cache. If |reload_pages| is true they will also reload - // all pages with plugins. CefRequestContextHandler::OnBeforePluginLoad may - // be called to rebuild the plugin list cache. - /// - /*--cef()--*/ - virtual void PurgePluginListCache(bool reload_pages) = 0; - /// // Returns true if a preference with the specified |name| exists. This method // must be called on the browser process UI thread. diff --git a/include/cef_request_context_handler.h b/include/cef_request_context_handler.h index 13cf1646e..3bf495dda 100644 --- a/include/cef_request_context_handler.h +++ b/include/cef_request_context_handler.h @@ -63,34 +63,6 @@ class CefRequestContextHandler : public virtual CefBaseRefCounted { virtual void OnRequestContextInitialized( CefRefPtr request_context) {} - /// - // Called on multiple browser process threads before a plugin instance is - // loaded. |mime_type| is the mime type of the plugin that will be loaded. - // |plugin_url| is the content URL that the plugin will load and may be empty. - // |is_main_frame| will be true if the plugin is being loaded in the main - // (top-level) frame, |top_origin_url| is the URL for the top-level frame that - // contains the plugin when loading a specific plugin instance or empty when - // building the initial list of enabled plugins for 'navigator.plugins' - // JavaScript state. |plugin_info| includes additional information about the - // plugin that will be loaded. |plugin_policy| is the recommended policy. - // Modify |plugin_policy| and return true to change the policy. Return false - // to use the recommended policy. The default plugin policy can be set at - // runtime using the `--plugin-policy=[allow|detect|block]` command-line flag. - // Decisions to mark a plugin as disabled by setting |plugin_policy| to - // PLUGIN_POLICY_DISABLED may be cached when |top_origin_url| is empty. To - // purge the plugin list cache and potentially trigger new calls to this - // method call CefRequestContext::PurgePluginListCache. - /// - /*--cef(optional_param=plugin_url,optional_param=top_origin_url)--*/ - virtual bool OnBeforePluginLoad(const CefString& mime_type, - const CefString& plugin_url, - bool is_main_frame, - const CefString& top_origin_url, - CefRefPtr plugin_info, - PluginPolicy* plugin_policy) { - return false; - } - /// // Called on the browser process IO thread before a resource request is // initiated. The |browser| and |frame| values represent the source of the diff --git a/libcef/browser/alloy/alloy_browser_host_impl.cc b/libcef/browser/alloy/alloy_browser_host_impl.cc index 5c8861d70..fdde30b09 100644 --- a/libcef/browser/alloy/alloy_browser_host_impl.cc +++ b/libcef/browser/alloy/alloy_browser_host_impl.cc @@ -1206,7 +1206,7 @@ bool AlloyBrowserHostImpl::TakeFocus(content::WebContents* source, } bool AlloyBrowserHostImpl::HandleContextMenu( - content::RenderFrameHost* render_frame_host, + content::RenderFrameHost& render_frame_host, const content::ContextMenuParams& params) { return HandleContextMenu(web_contents(), params); } diff --git a/libcef/browser/alloy/alloy_browser_host_impl.h b/libcef/browser/alloy/alloy_browser_host_impl.h index 1a46d996b..83563031c 100644 --- a/libcef/browser/alloy/alloy_browser_host_impl.h +++ b/libcef/browser/alloy/alloy_browser_host_impl.h @@ -224,7 +224,7 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase, bool proceed, bool* proceed_to_fire_unload) override; bool TakeFocus(content::WebContents* source, bool reverse) override; - bool HandleContextMenu(content::RenderFrameHost* render_frame_host, + bool HandleContextMenu(content::RenderFrameHost& render_frame_host, const content::ContextMenuParams& params) override; content::KeyboardEventProcessingResult PreHandleKeyboardEvent( content::WebContents* source, diff --git a/libcef/browser/alloy/alloy_content_browser_client.cc b/libcef/browser/alloy/alloy_content_browser_client.cc index faa1e2e99..caedfd73e 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.cc +++ b/libcef/browser/alloy/alloy_content_browser_client.cc @@ -28,7 +28,6 @@ #include "libcef/browser/net_service/login_delegate.h" #include "libcef/browser/net_service/proxy_url_loader_factory.h" #include "libcef/browser/net_service/resource_request_handler_wrapper.h" -#include "libcef/browser/plugins/plugin_service_filter.h" #include "libcef/browser/prefs/renderer_prefs.h" #include "libcef/browser/printing/print_view_manager.h" #include "libcef/browser/speech_recognition_manager_delegate.h" @@ -469,13 +468,9 @@ base::FilePath GetRootCachePath() { } // namespace -AlloyContentBrowserClient::AlloyContentBrowserClient() { - plugin_service_filter_.reset(new CefPluginServiceFilter); - content::PluginServiceImpl::GetInstance()->SetFilter( - plugin_service_filter_.get()); -} +AlloyContentBrowserClient::AlloyContentBrowserClient() = default; -AlloyContentBrowserClient::~AlloyContentBrowserClient() {} +AlloyContentBrowserClient::~AlloyContentBrowserClient() = default; std::unique_ptr AlloyContentBrowserClient::CreateBrowserMainParts( diff --git a/libcef/browser/alloy/alloy_content_browser_client.h b/libcef/browser/alloy/alloy_content_browser_client.h index 232986844..c81813405 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.h +++ b/libcef/browser/alloy/alloy_content_browser_client.h @@ -22,7 +22,6 @@ class AlloyBrowserMainParts; class CefDevToolsDelegate; namespace content { -class PluginServiceFilter; class SiteInstance; } // namespace content @@ -236,8 +235,6 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient { content::SiteInstance* site_instance); AlloyBrowserMainParts* browser_main_parts_ = nullptr; - - std::unique_ptr plugin_service_filter_; }; #endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_CONTENT_BROWSER_CLIENT_H_ diff --git a/libcef/browser/browser_contents_delegate.cc b/libcef/browser/browser_contents_delegate.cc index c7637ee3c..689b8880b 100644 --- a/libcef/browser/browser_contents_delegate.cc +++ b/libcef/browser/browser_contents_delegate.cc @@ -285,7 +285,7 @@ void CefBrowserContentsDelegate::RenderViewReady() { } } -void CefBrowserContentsDelegate::RenderProcessGone( +void CefBrowserContentsDelegate::PrimaryMainFrameRenderProcessGone( base::TerminationStatus status) { cef_termination_status_t ts = TS_ABNORMAL_TERMINATION; if (status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED) diff --git a/libcef/browser/browser_contents_delegate.h b/libcef/browser/browser_contents_delegate.h index 3bcb12934..01aa157d1 100644 --- a/libcef/browser/browser_contents_delegate.h +++ b/libcef/browser/browser_contents_delegate.h @@ -114,7 +114,8 @@ class CefBrowserContentsDelegate : public content::WebContentsDelegate, content::RenderFrameHost::LifecycleState new_state) override; void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override; void RenderViewReady() override; - void RenderProcessGone(base::TerminationStatus status) override; + void PrimaryMainFrameRenderProcessGone( + base::TerminationStatus status) override; void OnFrameFocused(content::RenderFrameHost* render_frame_host) override; void DocumentAvailableInMainFrame( content::RenderFrameHost* render_frame_host) override; diff --git a/libcef/browser/browser_context.cc b/libcef/browser/browser_context.cc index 92f3007b9..1c0dfe88b 100644 --- a/libcef/browser/browser_context.cc +++ b/libcef/browser/browser_context.cc @@ -314,10 +314,6 @@ void CefBrowserContext::OnRenderFrameDeleted( CEF_POST_TASK(CEF_IOT, base::BindOnce(&CefIOThreadState::RemoveHandler, iothread_state_, global_id)); } - - if (is_main_frame) { - ClearPluginLoadDecision(global_id.child_id); - } } CefRefPtr CefBrowserContext::GetHandler( @@ -349,58 +345,6 @@ bool CefBrowserContext::IsAssociatedContext( return false; } -void CefBrowserContext::AddPluginLoadDecision( - int render_process_id, - const base::FilePath& plugin_path, - bool is_main_frame, - const url::Origin& main_frame_origin, - chrome::mojom::PluginStatus status) { - CEF_REQUIRE_UIT(); - DCHECK_GE(render_process_id, 0); - DCHECK(!plugin_path.empty()); - - plugin_load_decision_map_.insert(std::make_pair( - std::make_pair(std::make_pair(render_process_id, plugin_path), - std::make_pair(is_main_frame, main_frame_origin)), - status)); -} - -bool CefBrowserContext::HasPluginLoadDecision( - int render_process_id, - const base::FilePath& plugin_path, - bool is_main_frame, - const url::Origin& main_frame_origin, - chrome::mojom::PluginStatus* status) const { - CEF_REQUIRE_UIT(); - DCHECK(frame_util::IsValidChildId(render_process_id)); - DCHECK(!plugin_path.empty()); - - PluginLoadDecisionMap::const_iterator it = plugin_load_decision_map_.find( - std::make_pair(std::make_pair(render_process_id, plugin_path), - std::make_pair(is_main_frame, main_frame_origin))); - if (it == plugin_load_decision_map_.end()) - return false; - - *status = it->second; - return true; -} - -void CefBrowserContext::ClearPluginLoadDecision(int render_process_id) { - CEF_REQUIRE_UIT(); - - if (!frame_util::IsValidChildId(render_process_id)) { - plugin_load_decision_map_.clear(); - } else { - PluginLoadDecisionMap::iterator it = plugin_load_decision_map_.begin(); - while (it != plugin_load_decision_map_.end()) { - if (it->first.first.first == render_process_id) - it = plugin_load_decision_map_.erase(it); - else - ++it; - } - } -} - void CefBrowserContext::RegisterSchemeHandlerFactory( const CefString& scheme_name, const CefString& domain_name, diff --git a/libcef/browser/browser_context.h b/libcef/browser/browser_context.h index a7f793612..f2c61a769 100644 --- a/libcef/browser/browser_context.h +++ b/libcef/browser/browser_context.h @@ -16,7 +16,7 @@ #include "base/callback.h" #include "base/files/file_path.h" #include "base/memory/weak_ptr.h" -#include "base/sequenced_task_runner_helpers.h" +#include "base/task/sequenced_task_runner_helpers.h" #include "chrome/common/plugin.mojom.h" #include "services/network/public/mojom/network_context.mojom.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -153,24 +153,6 @@ class CefBrowserContext { bool IsAssociatedContext(const content::GlobalRenderFrameHostId& global_id, bool require_frame_match) const; - // Remember the plugin load decision for plugin status requests that arrive - // via CefPluginServiceFilter::IsPluginAvailable. - void AddPluginLoadDecision(int render_process_id, - const base::FilePath& plugin_path, - bool is_main_frame, - const url::Origin& main_frame_origin, - chrome::mojom::PluginStatus status); - bool HasPluginLoadDecision(int render_process_id, - const base::FilePath& plugin_path, - bool is_main_frame, - const url::Origin& main_frame_origin, - chrome::mojom::PluginStatus* status) const; - - // Clear the plugin load decisions associated with |render_process_id|, or all - // plugin load decisions if |render_process_id| is - // content::ChildProcessHost::kInvalidUniqueID. - void ClearPluginLoadDecision(int render_process_id); - // Called from CefRequestContextImpl methods of the same name. void RegisterSchemeHandlerFactory(const CefString& scheme_name, const CefString& domain_name, @@ -243,14 +225,6 @@ class CefBrowserContext { // Map IDs to CefRequestContextHandler objects. CefRequestContextHandlerMap handler_map_; - // Map (render_process_id, plugin_path, is_main_frame, main_frame_origin) to - // plugin load decision. - typedef std::map< - std::pair, std::pair>, - chrome::mojom::PluginStatus> - PluginLoadDecisionMap; - PluginLoadDecisionMap plugin_load_decision_map_; - // Set of global IDs associated with this context. typedef std::set RenderIdSet; RenderIdSet render_id_set_; diff --git a/libcef/browser/browser_info_manager.h b/libcef/browser/browser_info_manager.h index 877be4219..6ad16d26e 100644 --- a/libcef/browser/browser_info_manager.h +++ b/libcef/browser/browser_info_manager.h @@ -8,14 +8,15 @@ #include "include/cef_client.h" +#include #include #include #include #include "libcef/browser/browser_info.h" -#include "base/sequenced_task_runner.h" #include "base/synchronization/lock.h" +#include "base/task/sequenced_task_runner.h" #include "cef/libcef/common/mojom/cef.mojom.h" #include "content/public/browser/global_routing_id.h" #include "content/public/browser/render_process_host_observer.h" @@ -123,7 +124,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver { bool* is_guest_view = nullptr); // Returns all existing CefBrowserInfo objects. - typedef std::list> BrowserInfoList; + using BrowserInfoList = std::list>; BrowserInfoList GetBrowserInfoList(); // Returns true if the navigation should be allowed to proceed, or false if diff --git a/libcef/browser/chrome/chrome_browser_main_extra_parts_cef.h b/libcef/browser/chrome/chrome_browser_main_extra_parts_cef.h index acab49096..8eaa7ce51 100644 --- a/libcef/browser/chrome/chrome_browser_main_extra_parts_cef.h +++ b/libcef/browser/chrome/chrome_browser_main_extra_parts_cef.h @@ -10,7 +10,7 @@ #include "libcef/browser/request_context_impl.h" #include "base/macros.h" -#include "base/single_thread_task_runner.h" +#include "base/task/single_thread_task_runner.h" #include "chrome/browser/chrome_browser_main_extra_parts.h" // Wrapper that owns and initialize the browser memory-related extra parts. diff --git a/libcef/browser/devtools/devtools_frontend.cc b/libcef/browser/devtools/devtools_frontend.cc index 24f52acb6..ce1cb02f0 100644 --- a/libcef/browser/devtools/devtools_frontend.cc +++ b/libcef/browser/devtools/devtools_frontend.cc @@ -329,7 +329,8 @@ void CefDevToolsFrontend::ReadyToCommitNavigation( return; } - std::string origin = navigation_handle->GetURL().GetOrigin().spec(); + std::string origin = + navigation_handle->GetURL().DeprecatedGetOriginAsURL().spec(); auto it = extensions_api_.find(origin); if (it == extensions_api_.end()) return; diff --git a/libcef/browser/extensions/extension_system.cc b/libcef/browser/extensions/extension_system.cc index 8386a2ec3..9fce20e15 100644 --- a/libcef/browser/extensions/extension_system.cc +++ b/libcef/browser/extensions/extension_system.cc @@ -618,11 +618,6 @@ void CefExtensionSystem::UnloadExtension(const std::string& extension_id, registry_->RemoveEnabled(extension->id()); NotifyExtensionUnloaded(extension.get(), reason); } - - content::NotificationService::current()->Notify( - extensions::NOTIFICATION_EXTENSION_REMOVED, - content::Source(browser_context_), - content::Details(extension.get())); } // Implementation based on ExtensionService::NotifyExtensionLoaded. diff --git a/libcef/browser/extensions/mime_handler_view_guest_delegate.cc b/libcef/browser/extensions/mime_handler_view_guest_delegate.cc index 49b411483..b7272f88f 100644 --- a/libcef/browser/extensions/mime_handler_view_guest_delegate.cc +++ b/libcef/browser/extensions/mime_handler_view_guest_delegate.cc @@ -63,13 +63,14 @@ void CefMimeHandlerViewGuestDelegate::OnGuestDetached() { } bool CefMimeHandlerViewGuestDelegate::HandleContextMenu( - content::WebContents* web_contents, + content::RenderFrameHost& render_frame_host, const content::ContextMenuParams& params) { CefRefPtr owner_browser = AlloyBrowserHostImpl::GetBrowserForContents(owner_web_contents_); DCHECK(owner_browser); - return owner_browser->HandleContextMenu(web_contents, params); + return owner_browser->HandleContextMenu( + content::WebContents::FromRenderFrameHost(&render_frame_host), params); } } // namespace extensions diff --git a/libcef/browser/extensions/mime_handler_view_guest_delegate.h b/libcef/browser/extensions/mime_handler_view_guest_delegate.h index 46e34cfac..b1c926467 100644 --- a/libcef/browser/extensions/mime_handler_view_guest_delegate.h +++ b/libcef/browser/extensions/mime_handler_view_guest_delegate.h @@ -25,7 +25,7 @@ class CefMimeHandlerViewGuestDelegate : public MimeHandlerViewGuestDelegate { content::WebContents::CreateParams* params) override; void OnGuestAttached() override; void OnGuestDetached() override; - bool HandleContextMenu(content::WebContents* web_contents, + bool HandleContextMenu(content::RenderFrameHost& render_frame_host, const content::ContextMenuParams& params) override; private: diff --git a/libcef/browser/net/chrome_scheme_handler.cc b/libcef/browser/net/chrome_scheme_handler.cc index 7f5be78e3..2be2756c3 100644 --- a/libcef/browser/net/chrome_scheme_handler.cc +++ b/libcef/browser/net/chrome_scheme_handler.cc @@ -75,7 +75,6 @@ const char kChromeUIWebUIHostsHost[] = "webui-hosts"; // additional changes. Do not add new hosts to this list without also manually // testing all related functionality in CEF. const char* kAllowedWebUIHosts[] = { - content::kChromeUIAppCacheInternalsHost, chrome::kChromeUIAccessibilityHost, content::kChromeUIBlobInternalsHost, chrome::kChromeUIChromeURLsHost, diff --git a/libcef/browser/net_service/url_loader_factory_getter.h b/libcef/browser/net_service/url_loader_factory_getter.h index 431515aa9..999f8d6e0 100644 --- a/libcef/browser/net_service/url_loader_factory_getter.h +++ b/libcef/browser/net_service/url_loader_factory_getter.h @@ -8,8 +8,8 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/sequenced_task_runner.h" -#include "base/sequenced_task_runner_helpers.h" +#include "base/task/sequenced_task_runner.h" +#include "base/task/sequenced_task_runner_helpers.h" #include "services/network/public/mojom/url_loader_factory.mojom.h" namespace content { diff --git a/libcef/browser/osr/render_widget_host_view_osr.cc b/libcef/browser/osr/render_widget_host_view_osr.cc index 89242bb90..c14087f46 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.cc +++ b/libcef/browser/osr/render_widget_host_view_osr.cc @@ -159,20 +159,6 @@ gfx::Rect GetViewBounds(AlloyBrowserHostImpl* browser) { return gfx::Rect(rc.x, rc.y, rc.width, rc.height); } -float GetDeviceScaleFactor(AlloyBrowserHostImpl* browser) { - if (!browser) - return kDefaultScaleFactor; - - CefScreenInfo screen_info(kDefaultScaleFactor, 0, 0, false, CefRect(), - CefRect()); - CefRefPtr handler = browser->client()->GetRenderHandler(); - CHECK(handler); - if (!handler->GetScreenInfo(browser, screen_info)) - return kDefaultScaleFactor; - - return screen_info.device_scale_factor; -} - ui::ImeTextSpan::UnderlineStyle GetImeUnderlineStyle( cef_composition_underline_style_t style) { switch (style) { @@ -210,8 +196,6 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR( DCHECK(render_widget_host_); DCHECK(!render_widget_host_->GetView()); - SetCurrentDeviceScaleFactor(kDefaultScaleFactor); - if (parent_host_view_) { browser_impl_ = parent_host_view_->browser_impl(); DCHECK(browser_impl_); @@ -671,7 +655,7 @@ void CefRenderWidgetHostViewOSR::UpdateTooltipUnderCursor( gfx::Size CefRenderWidgetHostViewOSR::GetCompositorViewportPixelSize() { return gfx::ScaleToCeiledSize(GetRequestedRendererSize(), - GetCurrentDeviceScaleFactor()); + GetDeviceScaleFactor()); } uint32_t CefRenderWidgetHostViewOSR::GetCaptureSequenceNumber() const { @@ -688,45 +672,42 @@ void CefRenderWidgetHostViewOSR::CopyFromSurface( } } -void CefRenderWidgetHostViewOSR::GetScreenInfo(display::ScreenInfo* results) { - if (!browser_impl_.get()) - return; +display::ScreenInfos CefRenderWidgetHostViewOSR::GetNewScreenInfosForUpdate() { + display::ScreenInfo display_screen_info; - CefScreenInfo screen_info(kDefaultScaleFactor, 0, 0, false, CefRect(), - CefRect()); + if (browser_impl_) { + CefScreenInfo screen_info(kDefaultScaleFactor, 0, 0, false, CefRect(), + CefRect()); - CefRefPtr handler = - browser_impl_->client()->GetRenderHandler(); - CHECK(handler); - if (!handler->GetScreenInfo(browser_impl_.get(), screen_info) || - screen_info.rect.width == 0 || screen_info.rect.height == 0 || - screen_info.available_rect.width == 0 || - screen_info.available_rect.height == 0) { - // If a screen rectangle was not provided, try using the view rectangle - // instead. Otherwise, popup views may be drawn incorrectly, or not at - // all. - CefRect screenRect; - handler->GetViewRect(browser_impl_.get(), screenRect); - CHECK_GT(screenRect.width, 0); - CHECK_GT(screenRect.height, 0); - - if (screen_info.rect.width == 0 || screen_info.rect.height == 0) { - screen_info.rect = screenRect; - } - - if (screen_info.available_rect.width == 0 || + CefRefPtr handler = + browser_impl_->client()->GetRenderHandler(); + CHECK(handler); + if (!handler->GetScreenInfo(browser_impl_.get(), screen_info) || + screen_info.rect.width == 0 || screen_info.rect.height == 0 || + screen_info.available_rect.width == 0 || screen_info.available_rect.height == 0) { - screen_info.available_rect = screenRect; + // If a screen rectangle was not provided, try using the view rectangle + // instead. Otherwise, popup views may be drawn incorrectly, or not at + // all. + CefRect screenRect; + handler->GetViewRect(browser_impl_.get(), screenRect); + CHECK_GT(screenRect.width, 0); + CHECK_GT(screenRect.height, 0); + + if (screen_info.rect.width == 0 || screen_info.rect.height == 0) { + screen_info.rect = screenRect; + } + + if (screen_info.available_rect.width == 0 || + screen_info.available_rect.height == 0) { + screen_info.available_rect = screenRect; + } } + + display_screen_info = ScreenInfoFrom(screen_info); } - *results = ScreenInfoFrom(screen_info); -} - -display::ScreenInfos CefRenderWidgetHostViewOSR::GetScreenInfos() { - display::ScreenInfo screen_info; - GetScreenInfo(&screen_info); - return display::ScreenInfos(screen_info); + return display::ScreenInfos(display_screen_info); } void CefRenderWidgetHostViewOSR::TransformPointToRootSurface( @@ -1311,7 +1292,7 @@ bool CefRenderWidgetHostViewOSR::ShouldRouteEvents() const { // Do not route events that are currently targeted to page popups such as //