| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 } else if (!browser_view_->IsFullscreen()) { | 158 } else if (!browser_view_->IsFullscreen()) { |
| 159 // We draw our own client edge over part of the default frame would be. | 159 // We draw our own client edge over part of the default frame would be. |
| 160 border_thickness = GetSystemMetrics(SM_CXSIZEFRAME) - kClientEdgeThickness; | 160 border_thickness = GetSystemMetrics(SM_CXSIZEFRAME) - kClientEdgeThickness; |
| 161 } | 161 } |
| 162 client_rect->left += border_thickness; | 162 client_rect->left += border_thickness; |
| 163 client_rect->right -= border_thickness; | 163 client_rect->right -= border_thickness; |
| 164 client_rect->bottom -= border_thickness; | 164 client_rect->bottom -= border_thickness; |
| 165 | 165 |
| 166 UpdateDWMFrame(); | 166 UpdateDWMFrame(); |
| 167 | 167 |
| 168 // Non-client metrics such as the window control positions may change as a |
| 169 // result of us processing this message so we need to re-layout the frame view |
| 170 // which may position items (such as the distributor logo) based on these |
| 171 // metrics. We only do this once the non-client view has been properly |
| 172 // initialized and added to the view hierarchy. |
| 173 views::NonClientView* non_client_view = GetNonClientView(); |
| 174 if (non_client_view && non_client_view->GetParent()) |
| 175 non_client_view->LayoutFrameView(); |
| 176 |
| 168 // We'd like to return WVR_REDRAW in some cases here, but because we almost | 177 // We'd like to return WVR_REDRAW in some cases here, but because we almost |
| 169 // always have nonclient area (except in fullscreen mode, where it doesn't | 178 // always have nonclient area (except in fullscreen mode, where it doesn't |
| 170 // matter), we can't. See comments in window.cc:OnNCCalcSize() for more info. | 179 // matter), we can't. See comments in window.cc:OnNCCalcSize() for more info. |
| 171 return 0; | 180 return 0; |
| 172 } | 181 } |
| 173 | 182 |
| 174 LRESULT BrowserFrame::OnNCHitTest(const CPoint& pt) { | 183 LRESULT BrowserFrame::OnNCHitTest(const CPoint& pt) { |
| 175 // Only do DWM hit-testing when we are using the native frame. | 184 // Only do DWM hit-testing when we are using the native frame. |
| 176 if (GetNonClientView()->UseNativeFrame()) { | 185 if (GetNonClientView()->UseNativeFrame()) { |
| 177 LRESULT result; | 186 LRESULT result; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 margins.cyBottomHeight = kClientEdgeThickness + 1; | 235 margins.cyBottomHeight = kClientEdgeThickness + 1; |
| 227 } | 236 } |
| 228 // 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 |
| 229 // borders. | 238 // borders. |
| 230 if (!browser_view_->IsFullscreen()) { | 239 if (!browser_view_->IsFullscreen()) { |
| 231 margins.cyTopHeight = | 240 margins.cyTopHeight = |
| 232 GetBoundsForTabStrip(browser_view_->tabstrip()).bottom(); | 241 GetBoundsForTabStrip(browser_view_->tabstrip()).bottom(); |
| 233 } | 242 } |
| 234 DwmExtendFrameIntoClientArea(GetNativeView(), &margins); | 243 DwmExtendFrameIntoClientArea(GetNativeView(), &margins); |
| 235 } | 244 } |
| OLD | NEW |