| 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" |
| 11 #include "ui/base/theme_provider.h" | 11 #include "ui/base/theme_provider.h" |
| 12 #include "ui/gfx/win/dpi.h" | 12 #include "ui/gfx/dpi.h" |
| 13 #include "ui/views/controls/menu/native_menu_win.h" | 13 #include "ui/views/controls/menu/native_menu_win.h" |
| 14 | 14 |
| 15 #pragma comment(lib, "dwmapi.lib") | 15 #pragma comment(lib, "dwmapi.lib") |
| 16 | 16 |
| 17 AppWindowDesktopWindowTreeHostWin::AppWindowDesktopWindowTreeHostWin( | 17 AppWindowDesktopWindowTreeHostWin::AppWindowDesktopWindowTreeHostWin( |
| 18 ChromeNativeAppWindowViewsWin* app_window, | 18 ChromeNativeAppWindowViewsWin* app_window, |
| 19 views::DesktopNativeWidgetAura* desktop_native_widget_aura) | 19 views::DesktopNativeWidgetAura* desktop_native_widget_aura) |
| 20 : DesktopWindowTreeHostWin(app_window->widget(), | 20 : DesktopWindowTreeHostWin(app_window->widget(), |
| 21 desktop_native_widget_aura), | 21 desktop_native_widget_aura), |
| 22 app_window_(app_window) { | 22 app_window_(app_window) { |
| (...skipping 45 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::GetDeviceScaleFactor()); |
| 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 |