| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/frame/browser_frame_win.h" | 5 #include "chrome/browser/ui/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 <set> | 10 #include <set> |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // Otherwise, we use the native frame when we're told we should by the theme | 117 // Otherwise, we use the native frame when we're told we should by the theme |
| 118 // provider (e.g. no custom theme is active). | 118 // provider (e.g. no custom theme is active). |
| 119 return GetThemeProvider()->ShouldUseNativeFrame(); | 119 return GetThemeProvider()->ShouldUseNativeFrame(); |
| 120 } | 120 } |
| 121 | 121 |
| 122 views::View* BrowserFrameWin::GetFrameView() const { | 122 views::View* BrowserFrameWin::GetFrameView() const { |
| 123 return browser_frame_view_; | 123 return browser_frame_view_; |
| 124 } | 124 } |
| 125 | 125 |
| 126 void BrowserFrameWin::TabStripDisplayModeChanged() { | 126 void BrowserFrameWin::TabStripDisplayModeChanged() { |
| 127 if (GetRootView()->GetChildViewCount() > 0) { | 127 if (GetRootView()->has_children()) { |
| 128 // Make sure the child of the root view gets Layout again. | 128 // Make sure the child of the root view gets Layout again. |
| 129 GetRootView()->GetChildViewAt(0)->InvalidateLayout(); | 129 GetRootView()->GetChildViewAt(0)->InvalidateLayout(); |
| 130 } | 130 } |
| 131 GetRootView()->Layout(); | 131 GetRootView()->Layout(); |
| 132 | 132 |
| 133 UpdateDWMFrame(); | 133 UpdateDWMFrame(); |
| 134 } | 134 } |
| 135 | 135 |
| 136 /////////////////////////////////////////////////////////////////////////////// | 136 /////////////////////////////////////////////////////////////////////////////// |
| 137 // BrowserFrame, views::WindowWin overrides: | 137 // BrowserFrame, views::WindowWin overrides: |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 gfx::Rect tabstrip_bounds( | 307 gfx::Rect tabstrip_bounds( |
| 308 GetBoundsForTabStrip(browser_view_->tabstrip())); | 308 GetBoundsForTabStrip(browser_view_->tabstrip())); |
| 309 margins.cyTopHeight = (browser_view_->UseVerticalTabs() ? | 309 margins.cyTopHeight = (browser_view_->UseVerticalTabs() ? |
| 310 tabstrip_bounds.y() : tabstrip_bounds.bottom()) + kDWMFrameTopOffset; | 310 tabstrip_bounds.y() : tabstrip_bounds.bottom()) + kDWMFrameTopOffset; |
| 311 } | 311 } |
| 312 } else { | 312 } else { |
| 313 // For popup and app windows we want to use the default margins. | 313 // For popup and app windows we want to use the default margins. |
| 314 } | 314 } |
| 315 DwmExtendFrameIntoClientArea(GetNativeView(), &margins); | 315 DwmExtendFrameIntoClientArea(GetNativeView(), &margins); |
| 316 } | 316 } |
| OLD | NEW |