| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/views/frame/browser_frame.h" | 5 #include "chrome/browser/views/frame/browser_frame.h" |
| 6 | 6 |
| 7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
| 8 #include <shellapi.h> | 8 #include <shellapi.h> |
| 9 | 9 |
| 10 #include "chrome/browser/browser_list.h" | 10 #include "chrome/browser/browser_list.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 if (browser_view_->IsMaximized()) { | 131 if (browser_view_->IsMaximized()) { |
| 132 // Make the maximized mode client rect fit the screen exactly, by | 132 // Make the maximized mode client rect fit the screen exactly, by |
| 133 // subtracting the border Windows automatically adds for maximized mode. | 133 // subtracting the border Windows automatically adds for maximized mode. |
| 134 border_thickness = GetSystemMetrics(SM_CXSIZEFRAME); | 134 border_thickness = GetSystemMetrics(SM_CXSIZEFRAME); |
| 135 // Find all auto-hide taskbars along the screen edges and adjust in by the | 135 // Find all auto-hide taskbars along the screen edges and adjust in by the |
| 136 // thickness of the auto-hide taskbar on each such edge, so the window isn't | 136 // thickness of the auto-hide taskbar on each such edge, so the window isn't |
| 137 // treated as a "fullscreen app", which would cause the taskbars to | 137 // treated as a "fullscreen app", which would cause the taskbars to |
| 138 // disappear. | 138 // disappear. |
| 139 HMONITOR monitor = MonitorFromWindow(GetNativeView(), | 139 HMONITOR monitor = MonitorFromWindow(GetNativeView(), |
| 140 MONITOR_DEFAULTTONEAREST); | 140 MONITOR_DEFAULTTONEAREST); |
| 141 if (win_util::EdgeHasAutoHideTaskbar(ABE_LEFT, monitor)) | 141 if (win_util::EdgeHasTopmostAutoHideTaskbar(ABE_LEFT, monitor)) |
| 142 client_rect->left += win_util::kAutoHideTaskbarThicknessPx; | 142 client_rect->left += win_util::kAutoHideTaskbarThicknessPx; |
| 143 if (win_util::EdgeHasAutoHideTaskbar(ABE_RIGHT, monitor)) | 143 if (win_util::EdgeHasTopmostAutoHideTaskbar(ABE_RIGHT, monitor)) |
| 144 client_rect->right -= win_util::kAutoHideTaskbarThicknessPx; | 144 client_rect->right -= win_util::kAutoHideTaskbarThicknessPx; |
| 145 if (win_util::EdgeHasAutoHideTaskbar(ABE_BOTTOM, monitor)) { | 145 if (win_util::EdgeHasTopmostAutoHideTaskbar(ABE_BOTTOM, monitor)) { |
| 146 client_rect->bottom -= win_util::kAutoHideTaskbarThicknessPx; | 146 client_rect->bottom -= win_util::kAutoHideTaskbarThicknessPx; |
| 147 } else if (win_util::EdgeHasAutoHideTaskbar(ABE_TOP, monitor)) { | 147 } else if (win_util::EdgeHasTopmostAutoHideTaskbar(ABE_TOP, monitor)) { |
| 148 // Tricky bit. Due to a bug in DwmDefWindowProc()'s handling of | 148 // Tricky bit. Due to a bug in DwmDefWindowProc()'s handling of |
| 149 // WM_NCHITTEST, having any nonclient area atop the window causes the | 149 // WM_NCHITTEST, having any nonclient area atop the window causes the |
| 150 // caption buttons to draw onscreen but not respond to mouse hover/clicks. | 150 // caption buttons to draw onscreen but not respond to mouse hover/clicks. |
| 151 // So for a taskbar at the screen top, we can't push the client_rect->top | 151 // So for a taskbar at the screen top, we can't push the client_rect->top |
| 152 // down; instead, we move the bottom up by one pixel, which is the | 152 // down; instead, we move the bottom up by one pixel, which is the |
| 153 // smallest change we can make and still get a client area less than the | 153 // smallest change we can make and still get a client area less than the |
| 154 // screen size. This is visibly ugly, but there seems to be no better | 154 // screen size. This is visibly ugly, but there seems to be no better |
| 155 // solution. | 155 // solution. |
| 156 --client_rect->bottom; | 156 --client_rect->bottom; |
| 157 } | 157 } |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 margins.cyBottomHeight = kClientEdgeThickness + 1; | 226 margins.cyBottomHeight = kClientEdgeThickness + 1; |
| 227 } | 227 } |
| 228 // In maximized mode, we only have a titlebar strip of glass, no side/bottom | 228 // In maximized mode, we only have a titlebar strip of glass, no side/bottom |
| 229 // borders. | 229 // borders. |
| 230 if (!browser_view_->IsFullscreen()) { | 230 if (!browser_view_->IsFullscreen()) { |
| 231 margins.cyTopHeight = | 231 margins.cyTopHeight = |
| 232 GetBoundsForTabStrip(browser_view_->tabstrip()).bottom(); | 232 GetBoundsForTabStrip(browser_view_->tabstrip()).bottom(); |
| 233 } | 233 } |
| 234 DwmExtendFrameIntoClientArea(GetNativeView(), &margins); | 234 DwmExtendFrameIntoClientArea(GetNativeView(), &margins); |
| 235 } | 235 } |
| OLD | NEW |