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

Unified Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 2702153003: [content] Fix background color update handling in RWHVAura. (Closed)
Patch Set: rebase Created 3 years, 8 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_mac.mm
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index 2b0a11d2a17b90d248e7fd40e21649042cd28697..6ea1ed045892f45e5bb6db5c6f51826c3fd2aebf 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -449,6 +449,7 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget,
is_guest_view_hack_(is_guest_view_hack),
fullscreen_parent_host_view_(nullptr),
needs_flush_input_(false),
+ background_color_(SK_ColorWHITE),
weak_factory_(this) {
// |cocoa_view_| owns us and we will be deleted when |cocoa_view_|
// goes away. Since we autorelease it, our caller must put
@@ -1644,9 +1645,11 @@ void RenderWidgetHostViewMac::ShowDefinitionForSelection() {
void RenderWidgetHostViewMac::SetBackgroundColor(SkColor color) {
if (color == background_color_)
return;
+ background_color_ = color;
- RenderWidgetHostViewBase::SetBackgroundColor(color);
- bool opaque = GetBackgroundOpaque();
+ DCHECK(SkColorGetA(color) == SK_AlphaOPAQUE ||
+ SkColorGetA(color) == SK_AlphaTRANSPARENT);
+ bool opaque = SkColorGetA(color) == SK_AlphaOPAQUE;
if (render_widget_host_)
render_widget_host_->SetBackgroundOpaque(opaque);
@@ -1661,6 +1664,10 @@ void RenderWidgetHostViewMac::SetBackgroundColor(SkColor color) {
[background_layer_ setBackgroundColor:cg_color];
}
+SkColor RenderWidgetHostViewMac::background_color() const {
+ return background_color_;
+}
+
BrowserAccessibilityManager*
RenderWidgetHostViewMac::CreateBrowserAccessibilityManager(
BrowserAccessibilityDelegate* delegate, bool for_root_frame) {

Powered by Google App Engine
This is Rietveld 408576698