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

Unified Diff: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.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/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
index 448baf898079c28dab37da1087c36257225f5e8c..3f47229ee59a0e9d1b718297084032ccc66f3dd2 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
@@ -30,10 +30,10 @@
#include "ui/base/dragdrop/os_exchange_data_provider_aurax11.h"
#include "ui/base/hit_test.h"
#include "ui/base/ime/input_method.h"
+#include "ui/base/layout.h"
#include "ui/base/x/x11_util.h"
#include "ui/base/x/x11_util_internal.h"
#include "ui/base/x/x11_window_event_manager.h"
-#include "ui/display/display.h"
#include "ui/display/screen.h"
#include "ui/events/devices/x11/device_data_manager_x11.h"
#include "ui/events/devices/x11/device_list_cache_x11.h"
@@ -1815,12 +1815,8 @@ void DesktopWindowTreeHostX11::ConvertEventToDifferentHost(
ui::LocatedEvent* located_event,
DesktopWindowTreeHostX11* host) {
DCHECK_NE(this, host);
- const display::Display display_src =
- display::Screen::GetScreen()->GetDisplayNearestWindow(window());
- const display::Display display_dest =
- display::Screen::GetScreen()->GetDisplayNearestWindow(host->window());
- DCHECK_EQ(display_src.device_scale_factor(),
- display_dest.device_scale_factor());
+ DCHECK_EQ(ui::GetScaleFactorForNativeView(window()),
+ ui::GetScaleFactorForNativeView(host->window()));
gfx::Vector2d offset =
GetLocationOnScreenInPixels() - host->GetLocationOnScreenInPixels();
gfx::PointF location_in_pixel_in_host =
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698