Commit 4edc9961 authored by Marshall Greenblatt's avatar Marshall Greenblatt

Remove an unused patch to ContentBrowserClient (issue #1161).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2044 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
parent ac4f451c
......@@ -951,31 +951,6 @@ void CefContentBrowserClient::OverrideWebkitPrefs(
!command_line->HasSwitch(switches::kEnableSpellingAutoCorrect);
}
SkColor CefContentBrowserClient::GetBaseBackgroundColor(
content::RenderViewHost* rvh) {
CefRefPtr<CefBrowserHostImpl> 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<CefBrowserHostImpl> 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;
}
......@@ -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<content::PluginServiceFilter> plugin_service_filter_;
......
......@@ -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 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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment