OLD | NEW |
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 17 matching lines...) Expand all Loading... |
28 namespace { | 28 namespace { |
29 | 29 |
30 // How many microseconds apart input events should be flushed. | 30 // How many microseconds apart input events should be flushed. |
31 const int kFlushInputRateInUs = 16666; | 31 const int kFlushInputRateInUs = 16666; |
32 | 32 |
33 } | 33 } |
34 | 34 |
35 RenderWidgetHostViewBase::RenderWidgetHostViewBase() | 35 RenderWidgetHostViewBase::RenderWidgetHostViewBase() |
36 : is_fullscreen_(false), | 36 : is_fullscreen_(false), |
37 popup_type_(blink::WebPopupTypeNone), | 37 popup_type_(blink::WebPopupTypeNone), |
38 background_color_(SK_ColorWHITE), | |
39 mouse_locked_(false), | 38 mouse_locked_(false), |
40 showing_context_menu_(false), | 39 showing_context_menu_(false), |
41 current_device_scale_factor_(0), | 40 current_device_scale_factor_(0), |
42 current_display_rotation_(display::Display::ROTATE_0), | 41 current_display_rotation_(display::Display::ROTATE_0), |
43 text_input_manager_(nullptr), | 42 text_input_manager_(nullptr), |
44 renderer_frame_number_(0), | 43 renderer_frame_number_(0), |
45 weak_factory_(this) { | 44 weak_factory_(this) { |
46 } | 45 } |
47 | 46 |
48 RenderWidgetHostViewBase::~RenderWidgetHostViewBase() { | 47 RenderWidgetHostViewBase::~RenderWidgetHostViewBase() { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 for (auto& observer : observers_) | 79 for (auto& observer : observers_) |
81 observer.OnRenderWidgetHostViewBaseDestroyed(this); | 80 observer.OnRenderWidgetHostViewBaseDestroyed(this); |
82 // All observers are required to disconnect after they are notified. | 81 // All observers are required to disconnect after they are notified. |
83 DCHECK(!observers_.might_have_observers()); | 82 DCHECK(!observers_.might_have_observers()); |
84 } | 83 } |
85 | 84 |
86 bool RenderWidgetHostViewBase::OnMessageReceived(const IPC::Message& msg){ | 85 bool RenderWidgetHostViewBase::OnMessageReceived(const IPC::Message& msg){ |
87 return false; | 86 return false; |
88 } | 87 } |
89 | 88 |
90 void RenderWidgetHostViewBase::SetBackgroundColor(SkColor color) { | |
91 background_color_ = color; | |
92 } | |
93 | |
94 SkColor RenderWidgetHostViewBase::background_color() { | |
95 return background_color_; | |
96 } | |
97 | |
98 void RenderWidgetHostViewBase::SetBackgroundColorToDefault() { | 89 void RenderWidgetHostViewBase::SetBackgroundColorToDefault() { |
99 SetBackgroundColor(SK_ColorWHITE); | 90 SetBackgroundColor(SK_ColorWHITE); |
100 } | 91 } |
101 | 92 |
102 bool RenderWidgetHostViewBase::GetBackgroundOpaque() { | |
103 return SkColorGetA(background_color_) == SK_AlphaOPAQUE; | |
104 } | |
105 | |
106 gfx::Size RenderWidgetHostViewBase::GetPhysicalBackingSize() const { | 93 gfx::Size RenderWidgetHostViewBase::GetPhysicalBackingSize() const { |
107 return gfx::ScaleToCeiledSize( | 94 return gfx::ScaleToCeiledSize( |
108 GetRequestedRendererSize(), | 95 GetRequestedRendererSize(), |
109 ui::GetScaleFactorForNativeView(GetNativeView())); | 96 ui::GetScaleFactorForNativeView(GetNativeView())); |
110 } | 97 } |
111 | 98 |
112 bool RenderWidgetHostViewBase::DoBrowserControlsShrinkBlinkSize() const { | 99 bool RenderWidgetHostViewBase::DoBrowserControlsShrinkBlinkSize() const { |
113 return false; | 100 return false; |
114 } | 101 } |
115 | 102 |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 | 501 |
515 bool RenderWidgetHostViewBase::IsChildFrameForTesting() const { | 502 bool RenderWidgetHostViewBase::IsChildFrameForTesting() const { |
516 return false; | 503 return false; |
517 } | 504 } |
518 | 505 |
519 cc::SurfaceId RenderWidgetHostViewBase::SurfaceIdForTesting() const { | 506 cc::SurfaceId RenderWidgetHostViewBase::SurfaceIdForTesting() const { |
520 return cc::SurfaceId(); | 507 return cc::SurfaceId(); |
521 } | 508 } |
522 | 509 |
523 } // namespace content | 510 } // namespace content |
OLD | NEW |