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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 | 6 |
7 #include "chrome/browser/views/frame/browser_view.h" | 7 #include "chrome/browser/views/frame/browser_view.h" |
8 | 8 |
9 #include "base/file_version_info.h" | 9 #include "base/file_version_info.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 // scroll bar. | 297 // scroll bar. |
298 int scrollbar_width = views::NativeScrollBar::GetVerticalScrollBarWidth(); | 298 int scrollbar_width = views::NativeScrollBar::GetVerticalScrollBarWidth(); |
299 bounding_box.set_width(std::max(0, bounding_box.width() - scrollbar_width)); | 299 bounding_box.set_width(std::max(0, bounding_box.width() - scrollbar_width)); |
300 if (UILayoutIsRightToLeft()) | 300 if (UILayoutIsRightToLeft()) |
301 bounding_box.set_x(bounding_box.x() + scrollbar_width); | 301 bounding_box.set_x(bounding_box.x() + scrollbar_width); |
302 | 302 |
303 return bounding_box; | 303 return bounding_box; |
304 } | 304 } |
305 | 305 |
306 int BrowserView::GetTabStripHeight() const { | 306 int BrowserView::GetTabStripHeight() const { |
307 return tabstrip_->height(); | 307 // We want to return tabstrip_->height(), but we might be called in the midst |
| 308 // of layout, when that hasn't yet been updated to reflect the current state. |
| 309 // So return what the tabstrip height _ought_ to be right now. |
| 310 return IsTabStripVisible() ? tabstrip_->GetPreferredSize().height() : 0; |
308 } | 311 } |
309 | 312 |
310 bool BrowserView::IsToolbarVisible() const { | 313 bool BrowserView::IsToolbarVisible() const { |
311 return SupportsWindowFeature(FEATURE_TOOLBAR) || | 314 return SupportsWindowFeature(FEATURE_TOOLBAR) || |
312 SupportsWindowFeature(FEATURE_LOCATIONBAR); | 315 SupportsWindowFeature(FEATURE_LOCATIONBAR); |
313 } | 316 } |
314 | 317 |
315 bool BrowserView::IsTabStripVisible() const { | 318 bool BrowserView::IsTabStripVisible() const { |
316 return SupportsWindowFeature(FEATURE_TABSTRIP); | 319 return SupportsWindowFeature(FEATURE_TABSTRIP); |
317 } | 320 } |
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1655 | 1658 |
1656 // static | 1659 // static |
1657 void BrowserView::InitClass() { | 1660 void BrowserView::InitClass() { |
1658 static bool initialized = false; | 1661 static bool initialized = false; |
1659 if (!initialized) { | 1662 if (!initialized) { |
1660 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 1663 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
1661 default_favicon_ = *rb.GetBitmapNamed(IDR_DEFAULT_FAVICON); | 1664 default_favicon_ = *rb.GetBitmapNamed(IDR_DEFAULT_FAVICON); |
1662 initialized = true; | 1665 initialized = true; |
1663 } | 1666 } |
1664 } | 1667 } |
OLD | NEW |