Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 1731373002: Allow to have a transparent UA dependent background. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Decouple background color and transparency in RenderWidgetHostView Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
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 6963b213ad3806a21bdf94826a1268a601d402f4..531bc42462486760e0f5ea6f02864d3774f9db90 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -958,6 +958,13 @@ void RenderWidgetHostViewAura::Focus() {
aura::client::FocusClient* client = aura::client::GetFocusClient(window_);
if (client)
window_->Focus();
+
+ // XXX This is for testing, it has to be moved to a unit or browser test.
+ // Which would call:
+ // content::RenderWidgetHostView->SetBackgroundColor(SK_ColorTRANSPARENT)
+ // content::RenderWidgetHostView->SetBackgroundOpaque(true)
+ SetBackgroundColor(SK_ColorTRANSPARENT);
+ SetBackgroundOpaque(true);
}
bool RenderWidgetHostViewAura::HasFocus() const {
@@ -978,10 +985,14 @@ gfx::Rect RenderWidgetHostViewAura::GetViewBounds() const {
void RenderWidgetHostViewAura::SetBackgroundColor(SkColor color) {
RenderWidgetHostViewBase::SetBackgroundColor(color);
- bool opaque = GetBackgroundOpaque();
+ host_->SetBackgroundColor(color);
+ window_->layer()->SetColor(color);
+}
+
+void RenderWidgetHostViewAura::SetBackgroundOpaque(bool opaque) {
+ RenderWidgetHostViewBase::SetBackgroundOpaque(opaque);
host_->SetBackgroundOpaque(opaque);
window_->layer()->SetFillsBoundsOpaquely(opaque);
- window_->layer()->SetColor(color);
}
gfx::Size RenderWidgetHostViewAura::GetVisibleViewportSize() const {

Powered by Google App Engine
This is Rietveld 408576698