From 4edc9961807c9d3f1a78fb013e9b31747f739366 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Wed, 4 Mar 2015 01:15:50 +0000 Subject: [PATCH] Remove an unused patch to ContentBrowserClient (issue #1161). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2044 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- libcef/browser/content_browser_client.cc | 50 +++++++++---------- libcef/browser/content_browser_client.h | 4 +- patch/patch.cfg | 5 +- ...1_1257.patch => public_browser_1257.patch} | 37 -------------- 4 files changed, 29 insertions(+), 67 deletions(-) rename patch/patches/{public_browser_1161_1257.patch => public_browser_1257.patch} (70%) diff --git a/libcef/browser/content_browser_client.cc b/libcef/browser/content_browser_client.cc index 859252231..f525edd19 100644 --- a/libcef/browser/content_browser_client.cc +++ b/libcef/browser/content_browser_client.cc @@ -951,31 +951,6 @@ void CefContentBrowserClient::OverrideWebkitPrefs( !command_line->HasSwitch(switches::kEnableSpellingAutoCorrect); } -SkColor CefContentBrowserClient::GetBaseBackgroundColor( - content::RenderViewHost* rvh) { - CefRefPtr browser = - CefBrowserHostImpl::GetBrowserForHost(rvh); - DCHECK(browser.get()); - - const CefBrowserSettings& browser_settings = browser->settings(); - if (CefColorGetA(browser_settings.background_color) > 0) { - return SkColorSetRGB( - CefColorGetR(browser_settings.background_color), - CefColorGetG(browser_settings.background_color), - CefColorGetB(browser_settings.background_color)); - } else { - const CefSettings& settings = CefContext::Get()->settings(); - if (CefColorGetA(settings.background_color) > 0) { - return SkColorSetRGB( - CefColorGetR(settings.background_color), - CefColorGetG(settings.background_color), - CefColorGetB(settings.background_color)); - } - } - - return SK_ColorWHITE; -} - void CefContentBrowserClient::BrowserURLHandlerCreated( content::BrowserURLHandler* handler) { // Used to redirect about: URLs to chrome: URLs. @@ -1051,3 +1026,28 @@ CefDevToolsDelegate* CefContentBrowserClient::devtools_delegate() const { PrefService* CefContentBrowserClient::pref_service() const { return browser_main_parts_->pref_service(); } + +SkColor CefContentBrowserClient::GetBaseBackgroundColor( + content::RenderViewHost* rvh) { + CefRefPtr browser = + CefBrowserHostImpl::GetBrowserForHost(rvh); + DCHECK(browser.get()); + + const CefBrowserSettings& browser_settings = browser->settings(); + if (CefColorGetA(browser_settings.background_color) > 0) { + return SkColorSetRGB( + CefColorGetR(browser_settings.background_color), + CefColorGetG(browser_settings.background_color), + CefColorGetB(browser_settings.background_color)); + } else { + const CefSettings& settings = CefContext::Get()->settings(); + if (CefColorGetA(settings.background_color) > 0) { + return SkColorSetRGB( + CefColorGetR(settings.background_color), + CefColorGetG(settings.background_color), + CefColorGetB(settings.background_color)); + } + } + + return SK_ColorWHITE; +} diff --git a/libcef/browser/content_browser_client.h b/libcef/browser/content_browser_client.h index cc23a846f..39b8b1109 100644 --- a/libcef/browser/content_browser_client.h +++ b/libcef/browser/content_browser_client.h @@ -21,6 +21,7 @@ #include "base/memory/scoped_ptr.h" #include "base/synchronization/lock.h" #include "content/public/browser/content_browser_client.h" +#include "third_party/skia/include/core/SkColor.h" #include "url/gurl.h" class CefBrowserInfo; @@ -133,7 +134,6 @@ class CefContentBrowserClient : public content::ContentBrowserClient { void ResourceDispatcherHostCreated() override; void OverrideWebkitPrefs(content::RenderViewHost* rvh, content::WebPreferences* prefs) override; - SkColor GetBaseBackgroundColor(content::RenderViewHost* rvh) override; void BrowserURLHandlerCreated( content::BrowserURLHandler* handler) override; std::string GetDefaultDownloadName() override; @@ -170,6 +170,8 @@ class CefContentBrowserClient : public content::ContentBrowserClient { PrefService* pref_service() const; private: + SkColor GetBaseBackgroundColor(content::RenderViewHost* rvh); + CefBrowserMainParts* browser_main_parts_; scoped_ptr plugin_service_filter_; diff --git a/patch/patch.cfg b/patch/patch.cfg index 05354c2a2..16688af44 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -59,12 +59,9 @@ patches = [ 'path': '../content/', }, { - # Allow customization of the background color with Aura. - # http://code.google.com/p/chromiumembedded/issues/detail?id=1161 - # # Allow specification of a custom WebContentsView. # http://code.google.com/p/chromiumembedded/issues/detail?id=1257 - 'name': 'public_browser_1161_1257', + 'name': 'public_browser_1257', 'path': '../content/public/browser/', }, { diff --git a/patch/patches/public_browser_1161_1257.patch b/patch/patches/public_browser_1257.patch similarity index 70% rename from patch/patches/public_browser_1161_1257.patch rename to patch/patches/public_browser_1257.patch index b961709c4..ad2dbafba 100644 --- a/patch/patches/public_browser_1161_1257.patch +++ b/patch/patches/public_browser_1257.patch @@ -1,40 +1,3 @@ -diff --git content_browser_client.cc content_browser_client.cc -index 67d2df7..e29a5d9 100644 ---- content_browser_client.cc -+++ content_browser_client.cc -@@ -278,6 +278,10 @@ bool ContentBrowserClient::IsFastShutdownPossible() { - return true; - } - -+SkColor ContentBrowserClient::GetBaseBackgroundColor(RenderViewHost* rvh) { -+ return SK_ColorWHITE; -+} -+ - base::FilePath ContentBrowserClient::GetDefaultDownloadDirectory() { - return base::FilePath(); - } -diff --git content_browser_client.h content_browser_client.h -index c4ab6f3..08583cf 100644 ---- content_browser_client.h -+++ content_browser_client.h -@@ -28,6 +28,7 @@ - #include "net/url_request/url_request_interceptor.h" - #include "net/url_request/url_request_job_factory.h" - #include "storage/browser/fileapi/file_system_context.h" -+#include "third_party/skia/include/core/SkColor.h" - #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" - #include "ui/base/window_open_disposition.h" - -@@ -510,6 +511,9 @@ class CONTENT_EXPORT ContentBrowserClient { - // Clears browser cookies. - virtual void ClearCookies(RenderViewHost* rvh) {} - -+ // Returns the base background color. -+ virtual SkColor GetBaseBackgroundColor(RenderViewHost* rvh); -+ - // Returns the default download directory. - // This can be called on any thread. - virtual base::FilePath GetDefaultDownloadDirectory(); diff --git web_contents.cc web_contents.cc index aece7c6..63da2c9 100644 --- web_contents.cc