summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/chromeos/login/webui_login_display_host.cc3
-rw-r--r--chrome/browser/chromeos/login/webui_login_view.cc5
-rw-r--r--content/browser/renderer_host/render_widget_host_view_aura.cc2
-rw-r--r--ui/aura/env.cc1
-rw-r--r--ui/aura/env.h8
5 files changed, 18 insertions, 1 deletions
diff --git a/chrome/browser/chromeos/login/webui_login_display_host.cc b/chrome/browser/chromeos/login/webui_login_display_host.cc
index 52a2024..8f71668 100644
--- a/chrome/browser/chromeos/login/webui_login_display_host.cc
+++ b/chrome/browser/chromeos/login/webui_login_display_host.cc
@@ -23,6 +23,7 @@
#include "chrome/common/chrome_switches.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/web_ui.h"
+#include "ui/aura/env.h"
#include "ui/aura/window.h"
#include "ui/views/widget/widget.h"
@@ -65,6 +66,8 @@ WebUILoginDisplayHost::WebUILoginDisplayHost(const gfx::Rect& background_bounds)
if (waiting_for_wallpaper_load_) {
registrar_.Add(this, chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED,
content::NotificationService::AllSources());
+ // Prevents white flashing on OOBE (http://crbug.com/131569).
+ aura::Env::GetInstance()->set_render_white_bg(false);
}
}
diff --git a/chrome/browser/chromeos/login/webui_login_view.cc b/chrome/browser/chromeos/login/webui_login_view.cc
index 582824c..5a8cecd 100644
--- a/chrome/browser/chromeos/login/webui_login_view.cc
+++ b/chrome/browser/chromeos/login/webui_login_view.cc
@@ -33,6 +33,7 @@
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
+#include "ui/aura/env.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/size.h"
#include "ui/views/controls/webview/webview.h"
@@ -348,6 +349,10 @@ void WebUILoginView::OnLoginPromptVisible() {
// Notify OOBE that the login frame has been rendered. Currently
// this is used to start camera presence check.
oobe_ui->OnLoginPromptVisible();
+
+ // Let RenderWidgetHostViewAura::OnPaint() show white background when
+ // loading page and when backing store is not present.
+ aura::Env::GetInstance()->set_render_white_bg(true);
}
void WebUILoginView::ReturnFocus(bool reverse) {
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 5fd9a2a..797481c 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -1210,7 +1210,7 @@ void RenderWidgetHostViewAura::OnPaint(gfx::Canvas* canvas) {
if (backing_store) {
static_cast<BackingStoreAura*>(backing_store)->SkiaShowRect(gfx::Point(),
canvas);
- } else {
+ } else if (aura::Env::GetInstance()->render_white_bg()) {
canvas->FillRect(gfx::Rect(window_->bounds().size()), SK_ColorWHITE);
}
}
diff --git a/ui/aura/env.cc b/ui/aura/env.cc
index cc84076..977e7ca 100644
--- a/ui/aura/env.cc
+++ b/ui/aura/env.cc
@@ -29,6 +29,7 @@ Env* Env::instance_ = NULL;
Env::Env()
: mouse_button_flags_(0),
is_touch_down_(false),
+ render_white_bg_(true),
stacking_client_(NULL) {
}
diff --git a/ui/aura/env.h b/ui/aura/env.h
index b68755c..0dcc8a8 100644
--- a/ui/aura/env.h
+++ b/ui/aura/env.h
@@ -50,6 +50,13 @@ class AURA_EXPORT Env {
bool is_touch_down() const { return is_touch_down_; }
void set_touch_down(bool value) { is_touch_down_ = value; }
+ // Whether RenderWidgetHostViewAura::OnPaint() should paint white background
+ // when backing store is not present. Default is true.
+ // In some cases when page is using transparent background painting white
+ // background before backing store is initialized causes a white splash.
+ bool render_white_bg() const { return render_white_bg_; }
+ void set_render_white_bg(bool value) { render_white_bg_ = value; }
+
client::StackingClient* stacking_client() { return stacking_client_; }
void set_stacking_client(client::StackingClient* stacking_client) {
stacking_client_ = stacking_client;
@@ -89,6 +96,7 @@ class AURA_EXPORT Env {
static Env* instance_;
int mouse_button_flags_;
bool is_touch_down_;
+ bool render_white_bg_;
client::StackingClient* stacking_client_;
scoped_ptr<DisplayManager> display_manager_;
scoped_ptr<EventFilter> event_filter_;