Index: content/browser/renderer_host/render_widget_host_view_aura.cc |
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc |
index 508adfec943695ea7967de3414fbc8705031ff06..1ce43cef0bd14e7787871d7b73ccf48757efded7 100644 |
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc |
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc |
@@ -103,7 +103,6 @@ |
#include "ui/base/win/hidden_window.h" |
#include "ui/gfx/gdi_util.h" |
#include "ui/gfx/screen_win.h" |
-#include "ui/gfx/win/dpi.h" |
#endif |
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
@@ -1194,8 +1193,9 @@ void RenderWidgetHostViewAura::UpdateConstrainedWindowRects( |
void RenderWidgetHostViewAura::UpdateMouseLockRegion() { |
// Clip the cursor if chrome is running on regular desktop. |
if (gfx::Screen::GetScreenFor(window_) == gfx::Screen::GetNativeScreen()) { |
- RECT window_rect = |
- gfx::win::DIPToScreenRect(window_->GetBoundsInScreen()).ToRECT(); |
+ RECT window_rect = gfx::ScreenWin::DIPToScreenRect( |
+ window_->GetHost()->GetAcceleratedWidget(), |
+ window_->GetBoundsInScreen()).ToRECT(); |
::ClipCursor(&window_rect); |
} |
} |
@@ -1274,10 +1274,10 @@ gfx::Rect RenderWidgetHostViewAura::GetBoundsInRootWindow() { |
// TODO(zturner,iyengar): This will break when we remove support for NPAPI and |
// remove the legacy hwnd, so a better fix will need to be decided when that |
// happens. |
+ aura::WindowTreeHost* host = top_level->GetHost(); |
if (UsesNativeWindowFrame()) { |
// aura::Window doesn't take into account non-client area of native windows |
// (e.g. HWNDs), so for that case ask Windows directly what the bounds are. |
- aura::WindowTreeHost* host = top_level->GetHost(); |
if (!host) |
return top_level->GetBoundsInScreen(); |
RECT window_rect = {0}; |
@@ -1298,7 +1298,8 @@ gfx::Rect RenderWidgetHostViewAura::GetBoundsInRootWindow() { |
} |
} |
- bounds = gfx::win::ScreenToDIPRect(bounds); |
+ bounds = gfx::ScreenWin::ScreenToDIPRect( |
+ host ? host->GetAcceleratedWidget() : nullptr, bounds); |
#endif |
return bounds; |