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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_base.cc

Issue 2702153003: [content] Fix background color update handling in RWHVAura. (Closed)
Patch Set: Remove GetBackgroundOpaque and base impls of accessors. Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/render_widget_host_view_base.h" 5 #include "content/browser/renderer_host/render_widget_host_view_base.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "content/browser/accessibility/browser_accessibility_manager.h" 9 #include "content/browser/accessibility/browser_accessibility_manager.h"
10 #include "content/browser/gpu/gpu_data_manager_impl.h" 10 #include "content/browser/gpu/gpu_data_manager_impl.h"
(...skipping 16 matching lines...) Expand all
27 namespace { 27 namespace {
28 28
29 // How many microseconds apart input events should be flushed. 29 // How many microseconds apart input events should be flushed.
30 const int kFlushInputRateInUs = 16666; 30 const int kFlushInputRateInUs = 16666;
31 31
32 } 32 }
33 33
34 RenderWidgetHostViewBase::RenderWidgetHostViewBase() 34 RenderWidgetHostViewBase::RenderWidgetHostViewBase()
35 : is_fullscreen_(false), 35 : is_fullscreen_(false),
36 popup_type_(blink::WebPopupTypeNone), 36 popup_type_(blink::WebPopupTypeNone),
37 background_color_(SK_ColorWHITE),
38 mouse_locked_(false), 37 mouse_locked_(false),
39 showing_context_menu_(false), 38 showing_context_menu_(false),
40 current_device_scale_factor_(0), 39 current_device_scale_factor_(0),
41 current_display_rotation_(display::Display::ROTATE_0), 40 current_display_rotation_(display::Display::ROTATE_0),
42 text_input_manager_(nullptr), 41 text_input_manager_(nullptr),
43 renderer_frame_number_(0), 42 renderer_frame_number_(0),
44 weak_factory_(this) { 43 weak_factory_(this) {
45 } 44 }
46 45
47 RenderWidgetHostViewBase::~RenderWidgetHostViewBase() { 46 RenderWidgetHostViewBase::~RenderWidgetHostViewBase() {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 for (auto& observer : observers_) 78 for (auto& observer : observers_)
80 observer.OnRenderWidgetHostViewBaseDestroyed(this); 79 observer.OnRenderWidgetHostViewBaseDestroyed(this);
81 // All observers are required to disconnect after they are notified. 80 // All observers are required to disconnect after they are notified.
82 DCHECK(!observers_.might_have_observers()); 81 DCHECK(!observers_.might_have_observers());
83 } 82 }
84 83
85 bool RenderWidgetHostViewBase::OnMessageReceived(const IPC::Message& msg){ 84 bool RenderWidgetHostViewBase::OnMessageReceived(const IPC::Message& msg){
86 return false; 85 return false;
87 } 86 }
88 87
89 void RenderWidgetHostViewBase::SetBackgroundColor(SkColor color) {
90 background_color_ = color;
91 }
92
93 SkColor RenderWidgetHostViewBase::background_color() {
94 return background_color_;
95 }
96
97 void RenderWidgetHostViewBase::SetBackgroundColorToDefault() { 88 void RenderWidgetHostViewBase::SetBackgroundColorToDefault() {
98 SetBackgroundColor(SK_ColorWHITE); 89 SetBackgroundColor(SK_ColorWHITE);
99 } 90 }
100 91
101 bool RenderWidgetHostViewBase::GetBackgroundOpaque() {
102 return SkColorGetA(background_color_) == SK_AlphaOPAQUE;
103 }
104
105 gfx::Size RenderWidgetHostViewBase::GetPhysicalBackingSize() const { 92 gfx::Size RenderWidgetHostViewBase::GetPhysicalBackingSize() const {
106 display::Display display = 93 display::Display display =
107 display::Screen::GetScreen()->GetDisplayNearestWindow(GetNativeView()); 94 display::Screen::GetScreen()->GetDisplayNearestWindow(GetNativeView());
108 return gfx::ScaleToCeiledSize(GetRequestedRendererSize(), 95 return gfx::ScaleToCeiledSize(GetRequestedRendererSize(),
109 display.device_scale_factor()); 96 display.device_scale_factor());
110 } 97 }
111 98
112 bool RenderWidgetHostViewBase::DoBrowserControlsShrinkBlinkSize() const { 99 bool RenderWidgetHostViewBase::DoBrowserControlsShrinkBlinkSize() const {
113 return false; 100 return false;
114 } 101 }
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 488
502 bool RenderWidgetHostViewBase::IsChildFrameForTesting() const { 489 bool RenderWidgetHostViewBase::IsChildFrameForTesting() const {
503 return false; 490 return false;
504 } 491 }
505 492
506 cc::SurfaceId RenderWidgetHostViewBase::SurfaceIdForTesting() const { 493 cc::SurfaceId RenderWidgetHostViewBase::SurfaceIdForTesting() const {
507 return cc::SurfaceId(); 494 return cc::SurfaceId();
508 } 495 }
509 496
510 } // namespace content 497 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698