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

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: Remove GetBackgroundOpaque and base impls of accessors. Created 3 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_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 3609b89c2f7b028a60ad47b47d1f8bc73292999c..04bf8034cbf5704e75a7705b8666d7b8036684f6 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -454,6 +454,7 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget,
needs_flush_input_(false),
selection_text_offset_(0),
selection_range_(gfx::Range::InvalidRange()),
+ 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
@@ -1630,9 +1631,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);
@@ -1647,6 +1650,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