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_win.h" | 5 #include "chrome/browser/views/frame/browser_frame_win.h" |
6 | 6 |
7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 | 9 |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 if (GetNonClientView()->UseNativeFrame()) { | 220 if (GetNonClientView()->UseNativeFrame()) { |
221 LRESULT result; | 221 LRESULT result; |
222 if (DwmDefWindowProc(GetNativeView(), WM_NCHITTEST, 0, | 222 if (DwmDefWindowProc(GetNativeView(), WM_NCHITTEST, 0, |
223 MAKELPARAM(pt.x, pt.y), &result)) { | 223 MAKELPARAM(pt.x, pt.y), &result)) { |
224 return result; | 224 return result; |
225 } | 225 } |
226 } | 226 } |
227 return WindowWin::OnNCHitTest(pt); | 227 return WindowWin::OnNCHitTest(pt); |
228 } | 228 } |
229 | 229 |
| 230 void BrowserFrameWin::OnWindowPosChanged(WINDOWPOS* window_pos) { |
| 231 // Windows lies to us about the position of the minimize button before a |
| 232 // window is visible. We use the position of the minimize button to place the |
| 233 // distributor logo in official builds. When the window is shown, we need to |
| 234 // re-layout and schedule a paint for the non-client frame view so that the |
| 235 // distributor logo has the correct position when the window becomes visible. |
| 236 // This fixes bugs where the distributor logo appears to overlay the minimize |
| 237 // button. http://crbug.com/15520 |
| 238 // Note that we will call Layout every time SetWindowPos is called with |
| 239 // SWP_SHOWWINDOW, however callers typically are careful about not specifying |
| 240 // this flag unless necessary to avoid flicker. |
| 241 if (window_pos->flags & SWP_SHOWWINDOW) { |
| 242 GetNonClientView()->Layout(); |
| 243 GetNonClientView()->SchedulePaint(); |
| 244 } |
| 245 WindowWin::OnWindowPosChanged(window_pos); |
| 246 } |
| 247 |
230 /////////////////////////////////////////////////////////////////////////////// | 248 /////////////////////////////////////////////////////////////////////////////// |
231 // BrowserFrame, views::CustomFrameWindow overrides: | 249 // BrowserFrame, views::CustomFrameWindow overrides: |
232 | 250 |
233 int BrowserFrameWin::GetShowState() const { | 251 int BrowserFrameWin::GetShowState() const { |
234 return browser_view_->GetShowState(); | 252 return browser_view_->GetShowState(); |
235 } | 253 } |
236 | 254 |
237 views::NonClientFrameView* BrowserFrameWin::CreateFrameViewForWindow() { | 255 views::NonClientFrameView* BrowserFrameWin::CreateFrameViewForWindow() { |
238 if (GetThemeProvider()->ShouldUseNativeFrame()) | 256 if (GetThemeProvider()->ShouldUseNativeFrame()) |
239 browser_frame_view_ = new GlassBrowserFrameView(this, browser_view_); | 257 browser_frame_view_ = new GlassBrowserFrameView(this, browser_view_); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 margins.cyBottomHeight = kClientEdgeThickness + 1; | 289 margins.cyBottomHeight = kClientEdgeThickness + 1; |
272 } | 290 } |
273 // In maximized mode, we only have a titlebar strip of glass, no side/bottom | 291 // In maximized mode, we only have a titlebar strip of glass, no side/bottom |
274 // borders. | 292 // borders. |
275 if (!browser_view_->IsFullscreen()) { | 293 if (!browser_view_->IsFullscreen()) { |
276 margins.cyTopHeight = | 294 margins.cyTopHeight = |
277 GetBoundsForTabStrip(browser_view_->tabstrip()).bottom(); | 295 GetBoundsForTabStrip(browser_view_->tabstrip()).bottom(); |
278 } | 296 } |
279 DwmExtendFrameIntoClientArea(GetNativeView(), &margins); | 297 DwmExtendFrameIntoClientArea(GetNativeView(), &margins); |
280 } | 298 } |
OLD | NEW |