Index: chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.cc |
diff --git a/chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.cc b/chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.cc |
index b2301e69bcfb06ec07e0dd16cf907c8173bb12e1..b14d3c07d621c34f75618ed3bb9b96ea0f625f15 100644 |
--- a/chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.cc |
+++ b/chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.cc |
@@ -72,11 +72,19 @@ void AppWindowDesktopWindowTreeHostWin::UpdateDWMFrame() { |
// If the opaque frame is visible, we use the default (zero) margins. |
// Otherwise, we need to figure out how to extend the glass in. |
if (app_window_->glass_frame_view()) { |
- gfx::Insets insets = app_window_->glass_frame_view()->GetGlassInsets(); |
- margins.cxLeftWidth = insets.left(); |
- margins.cxRightWidth = insets.right(); |
- margins.cyBottomHeight = insets.bottom(); |
- margins.cyTopHeight = insets.top(); |
+ gfx::Insets insets_in_dip = |
+ app_window_->glass_frame_view()->GetGlassInsetsInDIP(); |
+ // The DWM API's expect values in pixels. We need to convert from DIP to |
+ // pixels here. |
+ gfx::Rect insets_rect(insets_in_dip.left(), |
+ insets_in_dip.top(), |
+ insets_in_dip.right() - insets_in_dip.left(), |
+ insets_in_dip.bottom() - insets_in_dip.top()); |
+ insets_rect = gfx::win::DIPToScreenRect(insets_rect); |
+ margins.cxLeftWidth = insets_rect.x(); |
+ margins.cxRightWidth = insets_rect.x() + insets_rect.width(); |
+ margins.cyBottomHeight = insets_rect.y() + insets_rect.height(); |
+ margins.cyTopHeight = insets_rect.y(); |
} |
DwmExtendFrameIntoClientArea(GetHWND(), &margins); |