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

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

Issue 2751833004: Reland "Add display::GetDisplayNearestView" (Closed)
Patch Set: 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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 269
270 if (impl && impl->delegate()) 270 if (impl && impl->delegate())
271 impl->delegate()->SendScreenRects(); 271 impl->delegate()->SendScreenRects();
272 272
273 if (HasDisplayPropertyChanged(view) && impl) 273 if (HasDisplayPropertyChanged(view) && impl)
274 impl->NotifyScreenInfoChanged(); 274 impl->NotifyScreenInfoChanged();
275 } 275 }
276 276
277 bool RenderWidgetHostViewBase::HasDisplayPropertyChanged(gfx::NativeView view) { 277 bool RenderWidgetHostViewBase::HasDisplayPropertyChanged(gfx::NativeView view) {
278 display::Display display = 278 display::Display display =
279 display::Screen::GetScreen()->GetDisplayNearestWindow(view); 279 display::Screen::GetScreen()->GetDisplayNearestView(view);
280 if (current_display_area_ == display.work_area() && 280 if (current_display_area_ == display.work_area() &&
281 current_device_scale_factor_ == display.device_scale_factor() && 281 current_device_scale_factor_ == display.device_scale_factor() &&
282 current_display_rotation_ == display.rotation()) { 282 current_display_rotation_ == display.rotation()) {
283 return false; 283 return false;
284 } 284 }
285 285
286 current_display_area_ = display.work_area(); 286 current_display_area_ = display.work_area();
287 current_device_scale_factor_ = display.device_scale_factor(); 287 current_device_scale_factor_ = display.device_scale_factor();
288 current_display_rotation_ = display.rotation(); 288 current_display_rotation_ = display.rotation();
289 return true; 289 return true;
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 514
515 bool RenderWidgetHostViewBase::IsChildFrameForTesting() const { 515 bool RenderWidgetHostViewBase::IsChildFrameForTesting() const {
516 return false; 516 return false;
517 } 517 }
518 518
519 cc::SurfaceId RenderWidgetHostViewBase::SurfaceIdForTesting() const { 519 cc::SurfaceId RenderWidgetHostViewBase::SurfaceIdForTesting() const {
520 return cc::SurfaceId(); 520 return cc::SurfaceId();
521 } 521 }
522 522
523 } // namespace content 523 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698