| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 130   int border_thickness = 0; | 130   int border_thickness = 0; | 
| 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_DEFAULTTONULL); | 
| 141     if (win_util::EdgeHasTopmostAutoHideTaskbar(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::EdgeHasTopmostAutoHideTaskbar(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::EdgeHasTopmostAutoHideTaskbar(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::EdgeHasTopmostAutoHideTaskbar(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. | 
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 222 | 222 | 
| 223 void BrowserFrame::UpdateDWMFrame() { | 223 void BrowserFrame::UpdateDWMFrame() { | 
| 224   // Nothing to do yet. | 224   // Nothing to do yet. | 
| 225   if (!GetClientView() || !browser_view_->IsBrowserTypeNormal()) | 225   if (!GetClientView() || !browser_view_->IsBrowserTypeNormal()) | 
| 226     return; | 226     return; | 
| 227 | 227 | 
| 228   // In fullscreen mode, we don't extend glass into the client area at all, | 228   // In fullscreen mode, we don't extend glass into the client area at all, | 
| 229   // because the GDI-drawn text in the web content composited over it will | 229   // because the GDI-drawn text in the web content composited over it will | 
| 230   // become semi-transparent over any glass area. | 230   // become semi-transparent over any glass area. | 
| 231   MARGINS margins = { 0 }; | 231   MARGINS margins = { 0 }; | 
| 232   if (browser_view_->CanCurrentlyResize()) { | 232   if (!IsMaximized() && !IsFullscreen()) { | 
| 233     margins.cxLeftWidth = kClientEdgeThickness + 1; | 233     margins.cxLeftWidth = kClientEdgeThickness + 1; | 
| 234     margins.cxRightWidth = kClientEdgeThickness + 1; | 234     margins.cxRightWidth = kClientEdgeThickness + 1; | 
| 235     margins.cyBottomHeight = kClientEdgeThickness + 1; | 235     margins.cyBottomHeight = kClientEdgeThickness + 1; | 
| 236   } | 236   } | 
| 237   // In maximized mode, we only have a titlebar strip of glass, no side/bottom | 237   // In maximized mode, we only have a titlebar strip of glass, no side/bottom | 
| 238   // borders. | 238   // borders. | 
| 239   if (!browser_view_->IsFullscreen()) { | 239   if (!browser_view_->IsFullscreen()) { | 
| 240     margins.cyTopHeight = | 240     margins.cyTopHeight = | 
| 241         GetBoundsForTabStrip(browser_view_->tabstrip()).bottom(); | 241         GetBoundsForTabStrip(browser_view_->tabstrip()).bottom(); | 
| 242   } | 242   } | 
| 243   DwmExtendFrameIntoClientArea(GetNativeView(), &margins); | 243   DwmExtendFrameIntoClientArea(GetNativeView(), &margins); | 
| 244 } | 244 } | 
| OLD | NEW | 
|---|