OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.h
" | 5 #include "chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.h
" |
6 | 6 |
7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
8 | 8 |
9 #include "chrome/browser/ui/views/apps/chrome_native_app_window_views_win.h" | 9 #include "chrome/browser/ui/views/apps/chrome_native_app_window_views_win.h" |
10 #include "chrome/browser/ui/views/apps/glass_app_window_frame_view_win.h" | 10 #include "chrome/browser/ui/views/apps/glass_app_window_frame_view_win.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 return; | 68 return; |
69 | 69 |
70 MARGINS margins = {0}; | 70 MARGINS margins = {0}; |
71 | 71 |
72 // If the opaque frame is visible, we use the default (zero) margins. | 72 // If the opaque frame is visible, we use the default (zero) margins. |
73 // Otherwise, we need to figure out how to extend the glass in. | 73 // Otherwise, we need to figure out how to extend the glass in. |
74 if (app_window_->glass_frame_view()) { | 74 if (app_window_->glass_frame_view()) { |
75 gfx::Insets insets = app_window_->glass_frame_view()->GetGlassInsets(); | 75 gfx::Insets insets = app_window_->glass_frame_view()->GetGlassInsets(); |
76 // The DWM API's expect values in pixels. We need to convert from DIP to | 76 // The DWM API's expect values in pixels. We need to convert from DIP to |
77 // pixels here. | 77 // pixels here. |
78 insets = insets.Scale(gfx::win::GetDeviceScaleFactor()); | 78 insets = insets.Scale(gfx::GetDPIScale()); |
79 margins.cxLeftWidth = insets.left(); | 79 margins.cxLeftWidth = insets.left(); |
80 margins.cxRightWidth = insets.right(); | 80 margins.cxRightWidth = insets.right(); |
81 margins.cyBottomHeight = insets.bottom(); | 81 margins.cyBottomHeight = insets.bottom(); |
82 margins.cyTopHeight = insets.top(); | 82 margins.cyTopHeight = insets.top(); |
83 } | 83 } |
84 | 84 |
85 DwmExtendFrameIntoClientArea(GetHWND(), &margins); | 85 DwmExtendFrameIntoClientArea(GetHWND(), &margins); |
86 } | 86 } |
OLD | NEW |