mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add CefBrowserSettings.background_color for custom background color assignment on a per-browser basis and fix assignment of the default value (issue #1161).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1656 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -18,7 +18,7 @@ Index: common/webpreferences.h
|
||||
bool use_solid_color_scrollbars;
|
||||
bool compositor_touch_hit_testing;
|
||||
bool navigate_on_drag_drop;
|
||||
+ int base_background_color;
|
||||
+ uint32_t base_background_color;
|
||||
|
||||
// This flags corresponds to a Page's Settings' setCookieEnabled state. It
|
||||
// only controls whether or not the "document.cookie" field is properly
|
||||
|
37
patch/patches/public_browser_1161.patch
Normal file
37
patch/patches/public_browser_1161.patch
Normal file
@@ -0,0 +1,37 @@
|
||||
Index: content_browser_client.cc
|
||||
===================================================================
|
||||
--- content_browser_client.cc (revision 261035)
|
||||
+++ content_browser_client.cc (working copy)
|
||||
@@ -255,6 +255,10 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
+SkColor ContentBrowserClient::GetBaseBackgroundColor(RenderViewHost* rvh) {
|
||||
+ return SK_ColorWHITE;
|
||||
+}
|
||||
+
|
||||
base::FilePath ContentBrowserClient::GetDefaultDownloadDirectory() {
|
||||
return base::FilePath();
|
||||
}
|
||||
Index: content_browser_client.h
|
||||
===================================================================
|
||||
--- content_browser_client.h (revision 261035)
|
||||
+++ content_browser_client.h (working copy)
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "net/base/mime_util.h"
|
||||
#include "net/cookies/canonical_cookie.h"
|
||||
#include "net/url_request/url_request_job_factory.h"
|
||||
+#include "third_party/skia/include/core/SkColor.h"
|
||||
#include "third_party/WebKit/public/web/WebNotificationPresenter.h"
|
||||
#include "ui/base/window_open_disposition.h"
|
||||
#include "webkit/browser/fileapi/file_system_context.h"
|
||||
@@ -542,6 +543,9 @@
|
||||
// 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();
|
@@ -93,12 +93,16 @@ Index: render_widget_host_view_aura.cc
|
||||
===================================================================
|
||||
--- render_widget_host_view_aura.cc (revision 261035)
|
||||
+++ render_widget_host_view_aura.cc (working copy)
|
||||
@@ -2686,7 +2686,7 @@
|
||||
@@ -2685,8 +2685,10 @@
|
||||
// For non-opaque windows, we don't draw anything, since we depend on the
|
||||
// canvas coming from the compositor to already be initialized as
|
||||
// transparent.
|
||||
if (window_->layer()->fills_bounds_opaquely())
|
||||
- if (window_->layer()->fills_bounds_opaquely())
|
||||
- canvas->DrawColor(SK_ColorWHITE);
|
||||
+ canvas->DrawColor(SK_ColorTRANSPARENT);
|
||||
+ if (window_->layer()->fills_bounds_opaquely()) {
|
||||
+ canvas->DrawColor(GetContentClient()->browser()->GetBaseBackgroundColor(
|
||||
+ RenderViewHost::From(host_)));
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user