Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / views / apps / app_window_desktop_window_tree_host_win.cc
index f6a8139..5665d66 100644 (file)
@@ -8,7 +8,6 @@
 
 #include "chrome/browser/ui/views/apps/chrome_native_app_window_views_win.h"
 #include "chrome/browser/ui/views/apps/glass_app_window_frame_view_win.h"
-#include "grit/theme_resources.h"
 #include "ui/base/theme_provider.h"
 #include "ui/gfx/win/dpi.h"
 #include "ui/views/controls/menu/native_menu_win.h"
@@ -36,12 +35,12 @@ bool AppWindowDesktopWindowTreeHostWin::GetClientAreaInsets(
   // This tells Windows that most of the window is a client area, meaning Chrome
   // will draw it. Windows still fills in the glass bits because of the
   // DwmExtendFrameIntoClientArea call in |UpdateDWMFrame|.
-  // The 1 pixel edge is left on the sides and bottom as without this
+  // Without this 1 pixel offset on the right and bottom:
   //   * windows paint in a more standard way, and
   //   * get weird black bars at the top when maximized in multiple monitor
   //     configurations.
   int border_thickness = 1;
-  insets->Set(0, border_thickness, border_thickness, border_thickness);
+  insets->Set(0, 0, border_thickness, border_thickness);
   return true;
 }
 
@@ -74,6 +73,9 @@ void AppWindowDesktopWindowTreeHostWin::UpdateDWMFrame() {
   // 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();
+    // The DWM API's expect values in pixels. We need to convert from DIP to
+    // pixels here.
+    insets = insets.Scale(gfx::win::GetDeviceScaleFactor());
     margins.cxLeftWidth = insets.left();
     margins.cxRightWidth = insets.right();
     margins.cyBottomHeight = insets.bottom();