diff --git a/libcef/browser/browser_settings.cc b/libcef/browser/browser_settings.cc index d52658296..0e9919457 100644 --- a/libcef/browser/browser_settings.cc +++ b/libcef/browser/browser_settings.cc @@ -6,6 +6,7 @@ #include +#include "libcef/browser/context.h" #include "libcef/common/cef_switches.h" #include "base/command_line.h" @@ -126,4 +127,6 @@ void BrowserToWebSettings(const CefBrowserSettings& cef, WebPreferences& web) { web.experimental_webgl_enabled = false; if (cef.accelerated_compositing == STATE_DISABLED) web.accelerated_compositing_enabled = false; + + web.base_background_color = CefContext::Get()->settings().background_color; } diff --git a/patch/patch.cfg b/patch/patch.cfg index 292e1d47b..3cc1dc8fa 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -89,6 +89,20 @@ patches = [ 'name': 'renderer_host_1161', 'path': '../content/browser/renderer_host/', }, + { + # Allow customization of the WebView background color. + # http://code.google.com/p/chromiumembedded/issues/detail?id=1161 + # https://codereview.chromium.org/228603007/ + 'name': 'prefs_content_1161', + 'path': '../content/', + }, + { + # Allow customization of the WebView background color. + # http://code.google.com/p/chromiumembedded/issues/detail?id=1161 + # https://codereview.chromium.org/228603007/ + 'name': 'prefs_webkit_1161', + 'path': '../webkit/', + }, { # Disable scollbar bounce and overlay on OS X. # http://code.google.com/p/chromiumembedded/issues/detail?id=364 diff --git a/patch/patches/prefs_content_1161.patch b/patch/patches/prefs_content_1161.patch new file mode 100644 index 000000000..9f2230f21 --- /dev/null +++ b/patch/patches/prefs_content_1161.patch @@ -0,0 +1,25 @@ +Index: public/common/common_param_traits_macros.h +=================================================================== +--- public/common/common_param_traits_macros.h (revision 258314) ++++ public/common/common_param_traits_macros.h (working copy) +@@ -173,6 +173,7 @@ + IPC_STRUCT_TRAITS_MEMBER(initialize_at_minimum_page_scale) + IPC_STRUCT_TRAITS_MEMBER(smart_insert_delete_enabled) + IPC_STRUCT_TRAITS_MEMBER(compositor_touch_hit_testing) ++ IPC_STRUCT_TRAITS_MEMBER(base_background_color) + IPC_STRUCT_TRAITS_MEMBER(cookie_enabled) + IPC_STRUCT_TRAITS_MEMBER(spatial_navigation_enabled) + #if defined(OS_ANDROID) +Index: renderer/web_preferences.cc +=================================================================== +--- renderer/web_preferences.cc (revision 258314) ++++ renderer/web_preferences.cc (working copy) +@@ -161,6 +161,8 @@ + settings->setHyperlinkAuditingEnabled(prefs.hyperlink_auditing_enabled); + settings->setCookieEnabled(prefs.cookie_enabled); + ++ web_view->setBaseBackgroundColor(prefs.base_background_color); ++ + // This setting affects the behavior of links in an editable region: + // clicking the link should select it rather than navigate to it. + // Safari uses the same default. It is unlikley an embedder would want to diff --git a/patch/patches/prefs_webkit_1161.patch b/patch/patches/prefs_webkit_1161.patch new file mode 100644 index 000000000..7b9c4e477 --- /dev/null +++ b/patch/patches/prefs_webkit_1161.patch @@ -0,0 +1,24 @@ +Index: common/webpreferences.cc +=================================================================== +--- common/webpreferences.cc (revision 258314) ++++ common/webpreferences.cc (working copy) +@@ -123,6 +123,7 @@ + pinch_overlay_scrollbar_thickness(0), + use_solid_color_scrollbars(false), + compositor_touch_hit_testing(true), ++ base_background_color(0xFFFFFFFF), // Color::white + cookie_enabled(true) + #if defined(OS_ANDROID) + , +Index: common/webpreferences.h +=================================================================== +--- common/webpreferences.h (revision 258314) ++++ common/webpreferences.h (working copy) +@@ -158,6 +158,7 @@ + int pinch_overlay_scrollbar_thickness; + bool use_solid_color_scrollbars; + bool compositor_touch_hit_testing; ++ int 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 diff --git a/patch/patches/renderer_host_1161.patch b/patch/patches/renderer_host_1161.patch index 217619675..f16319ca5 100644 --- a/patch/patches/renderer_host_1161.patch +++ b/patch/patches/renderer_host_1161.patch @@ -1,6 +1,6 @@ Index: compositing_iosurface_layer_mac.mm =================================================================== ---- compositing_iosurface_layer_mac.mm (revision 247552) +--- compositing_iosurface_layer_mac.mm (revision 258314) +++ compositing_iosurface_layer_mac.mm (working copy) @@ -89,7 +89,7 @@ @@ -13,7 +13,7 @@ Index: compositing_iosurface_layer_mac.mm } Index: compositing_iosurface_mac.mm =================================================================== ---- compositing_iosurface_mac.mm (revision 247552) +--- compositing_iosurface_mac.mm (revision 258314) +++ compositing_iosurface_mac.mm (working copy) @@ -427,7 +427,7 @@ glUseProgram(0); CHECK_AND_SAVE_GL_ERROR(); @@ -26,7 +26,7 @@ Index: compositing_iosurface_mac.mm Index: compositing_iosurface_shader_programs_mac.cc =================================================================== ---- compositing_iosurface_shader_programs_mac.cc (revision 247552) +--- compositing_iosurface_shader_programs_mac.cc (revision 258314) +++ compositing_iosurface_shader_programs_mac.cc (working copy) @@ -11,6 +11,7 @@ #include "base/debug/trace_event.h" @@ -78,7 +78,7 @@ Index: compositing_iosurface_shader_programs_mac.cc shader_programs_[which] = Index: compositing_iosurface_shader_programs_mac.h =================================================================== ---- compositing_iosurface_shader_programs_mac.h (revision 247552) +--- compositing_iosurface_shader_programs_mac.h (revision 258314) +++ compositing_iosurface_shader_programs_mac.h (working copy) @@ -48,6 +48,8 @@ return rgb_to_yv12_output_format_; @@ -89,9 +89,22 @@ Index: compositing_iosurface_shader_programs_mac.h protected: FRIEND_TEST_ALL_PREFIXES(CompositingIOSurfaceTransformerTest, TransformsRGBToYV12); +Index: render_widget_host_view_aura.cc +=================================================================== +--- render_widget_host_view_aura.cc (revision 258314) ++++ render_widget_host_view_aura.cc (working copy) +@@ -2557,7 +2557,7 @@ + // canvas coming from the compositor to already be initialized as + // transparent. + if (window_->layer()->fills_bounds_opaquely()) +- canvas->DrawColor(SK_ColorWHITE); ++ canvas->DrawColor(SK_ColorTRANSPARENT); + } + } + Index: render_widget_host_view_mac.mm =================================================================== ---- render_widget_host_view_mac.mm (revision 247552) +--- render_widget_host_view_mac.mm (revision 258314) +++ render_widget_host_view_mac.mm (working copy) @@ -494,7 +494,7 @@ software_layer_.reset([[CALayer alloc] init]);