Index: ui/wm/core/default_screen_position_client.cc |
diff --git a/ui/wm/core/default_screen_position_client.cc b/ui/wm/core/default_screen_position_client.cc |
index d26a91ed9c8f92c66495eab9cfc7de7e5a749d87..13021a3175611f1a72a18b4ee50573fbb4c3d59d 100644 |
--- a/ui/wm/core/default_screen_position_client.cc |
+++ b/ui/wm/core/default_screen_position_client.cc |
@@ -7,6 +7,7 @@ |
#include "ui/aura/window_tree_host.h" |
#include "ui/gfx/display.h" |
#include "ui/gfx/geometry/point_conversions.h" |
+#include "ui/gfx/geometry/rect.h" |
#include "ui/gfx/screen.h" |
namespace wm { |
@@ -19,11 +20,11 @@ DefaultScreenPositionClient::~DefaultScreenPositionClient() { |
gfx::Point DefaultScreenPositionClient::GetOriginInScreen( |
const aura::Window* root_window) { |
- gfx::Point origin_in_pixels = root_window->GetHost()->GetBounds().origin(); |
aura::Window* window = const_cast<aura::Window*>(root_window); |
- float scale = gfx::Screen::GetScreenFor(window)-> |
- GetDisplayNearestWindow(window).device_scale_factor(); |
- return gfx::ScaleToFlooredPoint(origin_in_pixels, 1.0f / scale); |
+ gfx::Screen* screen = gfx::Screen::GetScreenFor(window); |
+ gfx::Rect screen_bounds = root_window->GetHost()->GetBounds(); |
+ gfx::Rect dip_bounds = screen->ScreenToDIPRectInWindow(window, screen_bounds); |
oshima
2016/01/21 17:47:44
is this screen_bounds in native screen coordinates
robliao
2016/01/21 18:19:20
We really need that units refactor.
GetOriginInSc
|
+ return dip_bounds.origin(); |
} |
void DefaultScreenPositionClient::ConvertPointToScreen( |