Index: ui/views/widget/desktop_aura/desktop_native_widget_aura.cc |
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc |
index ba42e9666c0f4d6cd6772388f5460b19e433264c..5a3c6a4163f9dd9bbcf908cd0b458e59a47018a8 100644 |
--- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc |
+++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc |
@@ -59,7 +59,7 @@ |
#if defined(OS_WIN) |
#include "ui/base/win/shell.h" |
-#include "ui/gfx/win/dpi.h" |
+#include "ui/gfx/screen_win.h" |
#endif |
DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(VIEWS_EXPORT, |
@@ -685,6 +685,12 @@ gfx::Rect DesktopNativeWidgetAura::GetRestoredBounds() const { |
void DesktopNativeWidgetAura::SetBounds(const gfx::Rect& bounds) { |
if (!content_window_) |
return; |
+#if defined(OS_WIN) |
+ // Windows has special scaling rules that do not apply to all platforms to |
+ // accommodate multiple monitors with differing DPIs. |
+ gfx::Rect bounds_in_pixels = |
+ gfx::ScreenWin::DIPToScreenRect(host_->GetAcceleratedWidget(), bounds); |
+#else |
// TODO(ananta) |
// This code by default scales the bounds rectangle by 1. |
// We could probably get rid of this and similar logic from |
@@ -697,6 +703,7 @@ void DesktopNativeWidgetAura::SetBounds(const gfx::Rect& bounds) { |
} |
gfx::Rect bounds_in_pixels = |
gfx::ScaleToEnclosingRect(bounds, scale, scale); |
+#endif |
desktop_window_tree_host_->AsWindowTreeHost()->SetBounds(bounds_in_pixels); |
} |