| 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 618d77449607e2a0d5878b299838f0acf951d633..6f2300dadb3e544f2924d853eae8e6c0e5fa50f1 100644
|
| --- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
|
| +++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
|
| @@ -61,7 +61,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,
|
| @@ -689,18 +689,9 @@ gfx::Rect DesktopNativeWidgetAura::GetRestoredBounds() const {
|
| void DesktopNativeWidgetAura::SetBounds(const gfx::Rect& bounds) {
|
| if (!content_window_)
|
| return;
|
| - // TODO(ananta)
|
| - // This code by default scales the bounds rectangle by 1.
|
| - // We could probably get rid of this and similar logic from
|
| - // the DesktopNativeWidgetAura::OnWindowTreeHostResized function.
|
| - float scale = 1;
|
| aura::Window* root = host_->window();
|
| - if (root) {
|
| - scale = gfx::Screen::GetScreenFor(root)->
|
| - GetDisplayNearestWindow(root).device_scale_factor();
|
| - }
|
| - gfx::Rect bounds_in_pixels =
|
| - gfx::ScaleToEnclosingRect(bounds, scale, scale);
|
| + gfx::Screen* screen = gfx::Screen::GetScreenFor(root);
|
| + gfx::Rect bounds_in_pixels = screen->DIPToScreenRectInWindow(root, bounds);
|
| desktop_window_tree_host_->AsWindowTreeHost()->SetBounds(bounds_in_pixels);
|
| }
|
|
|
|
|