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

Unified Diff: ui/aura/window_tree_host_platform.cc

Issue 2739113002: Simplify calls for scale factor (Closed)
Patch Set: nit 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/window_tree_host.cc ('k') | ui/aura/window_tree_host_x11.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window_tree_host_platform.cc
diff --git a/ui/aura/window_tree_host_platform.cc b/ui/aura/window_tree_host_platform.cc
index 54e820eb11a17b496d3d129ed2a46d80033db865..f824afd11405586a5efeda45ceffb31fb13415c4 100644
--- a/ui/aura/window_tree_host_platform.cc
+++ b/ui/aura/window_tree_host_platform.cc
@@ -10,9 +10,8 @@
#include "build/build_config.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_port.h"
+#include "ui/base/layout.h"
#include "ui/compositor/compositor.h"
-#include "ui/display/display.h"
-#include "ui/display/screen.h"
#include "ui/events/event.h"
#if defined(OS_ANDROID)
@@ -134,9 +133,7 @@ void WindowTreeHostPlatform::OnCursorVisibilityChangedNative(bool show) {
void WindowTreeHostPlatform::OnBoundsChanged(const gfx::Rect& new_bounds) {
float current_scale = compositor()->device_scale_factor();
- float new_scale = display::Screen::GetScreen()
- ->GetDisplayNearestWindow(window())
- .device_scale_factor();
+ float new_scale = ui::GetScaleFactorForNativeView(window());
gfx::Rect old_bounds = bounds_;
bounds_ = new_bounds;
if (bounds_.origin() != old_bounds.origin()) {
« no previous file with comments | « ui/aura/window_tree_host.cc ('k') | ui/aura/window_tree_host_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698