Chromium Code Reviews| 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 bbb79c967405304c7bb46b1823dfea04d09bf7f0..8caf7bfc01f9f903bf4d721ba90f53bdfd0d7605 100644 |
| --- a/content/browser/renderer_host/render_widget_host_view_aura.cc |
| +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc |
| @@ -98,7 +98,7 @@ |
| #include "content/common/plugin_constants_win.h" |
| #include "ui/base/win/hidden_window.h" |
| #include "ui/gfx/gdi_util.h" |
| -#include "ui/gfx/win/dpi.h" |
| +#include "ui/gfx/screen_win.h" |
| #endif |
| #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| @@ -1156,8 +1156,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); |
| } |
| } |
| @@ -1236,10 +1237,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}; |
| @@ -1260,7 +1261,8 @@ gfx::Rect RenderWidgetHostViewAura::GetBoundsInRootWindow() { |
| } |
| } |
| - bounds = gfx::win::ScreenToDIPRect(bounds); |
| + bounds = gfx::ScreenWin::ScreenToDIPRect( |
| + host ? host->GetAcceleratedWidget() : nullptr, bounds); |
|
scottmg
2015/10/28 18:48:21
What do we do when nullptr?
robliao
2015/10/29 00:30:24
This will tell ScreenToDIPRect to use the nearest
|
| #endif |
| return bounds; |