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

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

Issue 2688413007: Add display::GetDisplayNearestView (Closed)
Patch Set: updated log #2 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"
11 #include "content/browser/renderer_host/input/synthetic_gesture_target_base.h" 11 #include "content/browser/renderer_host/input/synthetic_gesture_target_base.h"
12 #include "content/browser/renderer_host/render_process_host_impl.h" 12 #include "content/browser/renderer_host/render_process_host_impl.h"
13 #include "content/browser/renderer_host/render_widget_host_delegate.h" 13 #include "content/browser/renderer_host/render_widget_host_delegate.h"
14 #include "content/browser/renderer_host/render_widget_host_impl.h" 14 #include "content/browser/renderer_host/render_widget_host_impl.h"
15 #include "content/browser/renderer_host/render_widget_host_view_base_observer.h" 15 #include "content/browser/renderer_host/render_widget_host_view_base_observer.h"
16 #include "content/browser/renderer_host/render_widget_host_view_frame_subscriber .h" 16 #include "content/browser/renderer_host/render_widget_host_view_frame_subscriber .h"
17 #include "content/browser/renderer_host/text_input_manager.h" 17 #include "content/browser/renderer_host/text_input_manager.h"
18 #include "content/common/content_switches_internal.h" 18 #include "content/common/content_switches_internal.h"
19 #include "media/base/video_frame.h" 19 #include "media/base/video_frame.h"
20 #include "ui/display/display.h" 20 #include "ui/base/layout.h"
21 #include "ui/display/screen.h" 21 #include "ui/display/screen.h"
22 #include "ui/gfx/geometry/point_conversions.h" 22 #include "ui/gfx/geometry/point_conversions.h"
23 #include "ui/gfx/geometry/size_conversions.h" 23 #include "ui/gfx/geometry/size_conversions.h"
24 #include "ui/gfx/geometry/size_f.h" 24 #include "ui/gfx/geometry/size_f.h"
25 25
26 namespace content { 26 namespace content {
27 27
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.
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 void RenderWidgetHostViewBase::SetBackgroundColorToDefault() { 98 void RenderWidgetHostViewBase::SetBackgroundColorToDefault() {
99 SetBackgroundColor(SK_ColorWHITE); 99 SetBackgroundColor(SK_ColorWHITE);
100 } 100 }
101 101
102 bool RenderWidgetHostViewBase::GetBackgroundOpaque() { 102 bool RenderWidgetHostViewBase::GetBackgroundOpaque() {
103 return SkColorGetA(background_color_) == SK_AlphaOPAQUE; 103 return SkColorGetA(background_color_) == SK_AlphaOPAQUE;
104 } 104 }
105 105
106 gfx::Size RenderWidgetHostViewBase::GetPhysicalBackingSize() const { 106 gfx::Size RenderWidgetHostViewBase::GetPhysicalBackingSize() const {
107 display::Display display = 107 return gfx::ScaleToCeiledSize(
108 display::Screen::GetScreen()->GetDisplayNearestWindow(GetNativeView()); 108 GetRequestedRendererSize(),
109 return gfx::ScaleToCeiledSize(GetRequestedRendererSize(), 109 ui::GetScaleFactorForNativeView(GetNativeView()));
110 display.device_scale_factor());
111 } 110 }
112 111
113 bool RenderWidgetHostViewBase::DoBrowserControlsShrinkBlinkSize() const { 112 bool RenderWidgetHostViewBase::DoBrowserControlsShrinkBlinkSize() const {
114 return false; 113 return false;
115 } 114 }
116 115
117 float RenderWidgetHostViewBase::GetTopControlsHeight() const { 116 float RenderWidgetHostViewBase::GetTopControlsHeight() const {
118 return 0.f; 117 return 0.f;
119 } 118 }
120 119
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 269
271 if (impl && impl->delegate()) 270 if (impl && impl->delegate())
272 impl->delegate()->SendScreenRects(); 271 impl->delegate()->SendScreenRects();
273 272
274 if (HasDisplayPropertyChanged(view) && impl) 273 if (HasDisplayPropertyChanged(view) && impl)
275 impl->NotifyScreenInfoChanged(); 274 impl->NotifyScreenInfoChanged();
276 } 275 }
277 276
278 bool RenderWidgetHostViewBase::HasDisplayPropertyChanged(gfx::NativeView view) { 277 bool RenderWidgetHostViewBase::HasDisplayPropertyChanged(gfx::NativeView view) {
279 display::Display display = 278 display::Display display =
280 display::Screen::GetScreen()->GetDisplayNearestWindow(view); 279 display::Screen::GetScreen()->GetDisplayNearestView(view);
281 if (current_display_area_ == display.work_area() && 280 if (current_display_area_ == display.work_area() &&
282 current_device_scale_factor_ == display.device_scale_factor() && 281 current_device_scale_factor_ == display.device_scale_factor() &&
283 current_display_rotation_ == display.rotation()) { 282 current_display_rotation_ == display.rotation()) {
284 return false; 283 return false;
285 } 284 }
286 285
287 current_display_area_ = display.work_area(); 286 current_display_area_ = display.work_area();
288 current_device_scale_factor_ = display.device_scale_factor(); 287 current_device_scale_factor_ = display.device_scale_factor();
289 current_display_rotation_ = display.rotation(); 288 current_display_rotation_ = display.rotation();
290 return true; 289 return true;
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 514
516 bool RenderWidgetHostViewBase::IsChildFrameForTesting() const { 515 bool RenderWidgetHostViewBase::IsChildFrameForTesting() const {
517 return false; 516 return false;
518 } 517 }
519 518
520 cc::SurfaceId RenderWidgetHostViewBase::SurfaceIdForTesting() const { 519 cc::SurfaceId RenderWidgetHostViewBase::SurfaceIdForTesting() const {
521 return cc::SurfaceId(); 520 return cc::SurfaceId();
522 } 521 }
523 522
524 } // namespace content 523 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698