Windows: Fix white flashes during browser initialization (issue #1161).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1645 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2014-04-08 19:33:48 +00:00
parent d8aed5b52d
commit 66604e4741
5 changed files with 79 additions and 0 deletions

View File

@ -6,6 +6,7 @@
#include <string>
#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;
}

View File

@ -72,6 +72,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/',
},
{
# Pass RenderFrameHost to WebContentsDelegate::HandleContextMenu.
# https://codereview.chromium.org/148843003/

View File

@ -0,0 +1,25 @@
Index: public/common/common_param_traits_macros.h
===================================================================
--- public/common/common_param_traits_macros.h (revision 261035)
+++ public/common/common_param_traits_macros.h (working copy)
@@ -182,6 +182,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(navigate_on_drag_drop)
IPC_STRUCT_TRAITS_MEMBER(spatial_navigation_enabled)
Index: renderer/web_preferences.cc
===================================================================
--- renderer/web_preferences.cc (revision 261035)
+++ renderer/web_preferences.cc (working copy)
@@ -163,6 +163,8 @@
settings->setCookieEnabled(prefs.cookie_enabled);
settings->setNavigateOnDragDrop(prefs.navigate_on_drag_drop);
+ 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

View File

@ -0,0 +1,24 @@
Index: common/webpreferences.cc
===================================================================
--- common/webpreferences.cc (revision 261035)
+++ common/webpreferences.cc (working copy)
@@ -121,6 +121,7 @@
use_solid_color_scrollbars(false),
compositor_touch_hit_testing(true),
navigate_on_drag_drop(true),
+ base_background_color(0xFFFFFFFF), // Color::white
cookie_enabled(true),
pepper_accelerated_video_decode_enabled(false)
#if defined(OS_ANDROID)
Index: common/webpreferences.h
===================================================================
--- common/webpreferences.h (revision 261035)
+++ common/webpreferences.h (working copy)
@@ -156,6 +156,7 @@
bool use_solid_color_scrollbars;
bool compositor_touch_hit_testing;
bool navigate_on_drag_drop;
+ 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

View File

@ -89,6 +89,19 @@ 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 261035)
+++ render_widget_host_view_aura.cc (working copy)
@@ -2686,7 +2686,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 261035)