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_view2.h" | 5 #include "chrome/browser/views/frame/browser_view2.h" |
6 | 6 |
7 #include "chrome/app/chrome_dll_resource.h" | 7 #include "chrome/app/chrome_dll_resource.h" |
8 #include "chrome/app/theme/theme_resources.h" | 8 #include "chrome/app/theme/theme_resources.h" |
9 #include "chrome/browser/app_modal_dialog_queue.h" | 9 #include "chrome/browser/app_modal_dialog_queue.h" |
10 #include "chrome/browser/browser.h" | 10 #include "chrome/browser/browser.h" |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 toolbar_->Update(contents, should_restore_state); | 433 toolbar_->Update(contents, should_restore_state); |
434 } | 434 } |
435 | 435 |
436 void BrowserView2::FocusToolbar() { | 436 void BrowserView2::FocusToolbar() { |
437 toolbar_->RequestFocus(); | 437 toolbar_->RequestFocus(); |
438 } | 438 } |
439 | 439 |
440 void BrowserView2::DestroyBrowser() { | 440 void BrowserView2::DestroyBrowser() { |
441 } | 441 } |
442 | 442 |
| 443 bool BrowserView2::IsBookmarkBarVisible() const { |
| 444 if (!bookmark_bar_view_.get()) |
| 445 return false; |
| 446 |
| 447 if (bookmark_bar_view_->IsNewTabPage() || bookmark_bar_view_->IsAnimating()) |
| 448 return true; |
| 449 |
| 450 CSize sz; |
| 451 bookmark_bar_view_->GetPreferredSize(&sz); |
| 452 // 1 is the minimum in GetPreferredSize for the bookmark bar. |
| 453 return sz.cy > 1; |
| 454 } |
| 455 |
443 /////////////////////////////////////////////////////////////////////////////// | 456 /////////////////////////////////////////////////////////////////////////////// |
444 // BrowserView2, NotificationObserver implementation: | 457 // BrowserView2, NotificationObserver implementation: |
445 | 458 |
446 void BrowserView2::Observe(NotificationType type, | 459 void BrowserView2::Observe(NotificationType type, |
447 const NotificationSource& source, | 460 const NotificationSource& source, |
448 const NotificationDetails& details) { | 461 const NotificationDetails& details) { |
449 if (type == NOTIFY_PREF_CHANGED && | 462 if (type == NOTIFY_PREF_CHANGED && |
450 *Details<std::wstring>(details).ptr() == prefs::kShowBookmarkBar) { | 463 *Details<std::wstring>(details).ptr() == prefs::kShowBookmarkBar) { |
451 if (MaybeShowBookmarkBar(browser_->GetSelectedTabContents())) | 464 if (MaybeShowBookmarkBar(browser_->GetSelectedTabContents())) |
452 Layout(); | 465 Layout(); |
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1070 // static | 1083 // static |
1071 void BrowserView2::InitClass() { | 1084 void BrowserView2::InitClass() { |
1072 static bool initialized = false; | 1085 static bool initialized = false; |
1073 if (!initialized) { | 1086 if (!initialized) { |
1074 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 1087 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
1075 default_favicon_ = *rb.GetBitmapNamed(IDR_DEFAULT_FAVICON); | 1088 default_favicon_ = *rb.GetBitmapNamed(IDR_DEFAULT_FAVICON); |
1076 initialized = true; | 1089 initialized = true; |
1077 } | 1090 } |
1078 } | 1091 } |
1079 | 1092 |
OLD | NEW |