| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/toolbar_view.h" | 5 #include "chrome/browser/views/toolbar_view.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/i18n/number_formatting.h" | 9 #include "base/i18n/number_formatting.h" |
| 10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 #endif | 226 #endif |
| 227 AddChildView(app_menu_); | 227 AddChildView(app_menu_); |
| 228 | 228 |
| 229 location_bar_->Init(); | 229 location_bar_->Init(); |
| 230 show_home_button_.Init(prefs::kShowHomeButton, profile->GetPrefs(), this); | 230 show_home_button_.Init(prefs::kShowHomeButton, profile->GetPrefs(), this); |
| 231 browser_actions_->Init(); | 231 browser_actions_->Init(); |
| 232 | 232 |
| 233 SetProfile(profile); | 233 SetProfile(profile); |
| 234 | 234 |
| 235 // Accessibility specific tooltip text. | 235 // Accessibility specific tooltip text. |
| 236 if (Singleton<BrowserAccessibilityState>()->IsAccessibleBrowser()) { | 236 if (BrowserAccessibilityState::GetInstance()->IsAccessibleBrowser()) { |
| 237 back_->SetTooltipText(l10n_util::GetString(IDS_ACCNAME_TOOLTIP_BACK)); | 237 back_->SetTooltipText(l10n_util::GetString(IDS_ACCNAME_TOOLTIP_BACK)); |
| 238 forward_->SetTooltipText(l10n_util::GetString(IDS_ACCNAME_TOOLTIP_FORWARD)); | 238 forward_->SetTooltipText(l10n_util::GetString(IDS_ACCNAME_TOOLTIP_FORWARD)); |
| 239 } | 239 } |
| 240 } | 240 } |
| 241 | 241 |
| 242 void ToolbarView::SetProfile(Profile* profile) { | 242 void ToolbarView::SetProfile(Profile* profile) { |
| 243 if (profile != profile_) { | 243 if (profile != profile_) { |
| 244 profile_ = profile; | 244 profile_ = profile; |
| 245 location_bar_->SetProfile(profile); | 245 location_bar_->SetProfile(profile); |
| 246 } | 246 } |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 } | 621 } |
| 622 | 622 |
| 623 //////////////////////////////////////////////////////////////////////////////// | 623 //////////////////////////////////////////////////////////////////////////////// |
| 624 // ToolbarView, private: | 624 // ToolbarView, private: |
| 625 | 625 |
| 626 bool ToolbarView::IsUpgradeRecommended() { | 626 bool ToolbarView::IsUpgradeRecommended() { |
| 627 #if defined(OS_CHROMEOS) | 627 #if defined(OS_CHROMEOS) |
| 628 return (chromeos::CrosLibrary::Get()->GetUpdateLibrary()->status().status == | 628 return (chromeos::CrosLibrary::Get()->GetUpdateLibrary()->status().status == |
| 629 chromeos::UPDATE_STATUS_UPDATED_NEED_REBOOT); | 629 chromeos::UPDATE_STATUS_UPDATED_NEED_REBOOT); |
| 630 #else | 630 #else |
| 631 return (Singleton<UpgradeDetector>::get()->notify_upgrade()); | 631 return (UpgradeDetector::GetInstance()->notify_upgrade()); |
| 632 #endif | 632 #endif |
| 633 } | 633 } |
| 634 | 634 |
| 635 bool ToolbarView::ShouldShowBackgroundPageBadge() { | 635 bool ToolbarView::ShouldShowBackgroundPageBadge() { |
| 636 return BackgroundPageTracker::GetSingleton()-> | 636 return BackgroundPageTracker::GetSingleton()-> |
| 637 GetUnacknowledgedBackgroundPageCount() > 0; | 637 GetUnacknowledgedBackgroundPageCount() > 0; |
| 638 } | 638 } |
| 639 | 639 |
| 640 bool ToolbarView::ShouldShowIncompatibilityWarning() { | 640 bool ToolbarView::ShouldShowIncompatibilityWarning() { |
| 641 #if defined(OS_WIN) | 641 #if defined(OS_WIN) |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 SkBitmap* badge = tp->GetBitmapNamed(IDR_BACKGROUND_BADGE); | 762 SkBitmap* badge = tp->GetBitmapNamed(IDR_BACKGROUND_BADGE); |
| 763 string16 badge_text = base::FormatNumber( | 763 string16 badge_text = base::FormatNumber( |
| 764 BackgroundPageTracker::GetSingleton()->GetBackgroundPageCount()); | 764 BackgroundPageTracker::GetSingleton()->GetBackgroundPageCount()); |
| 765 return badge_util::DrawBadgeIconOverlay( | 765 return badge_util::DrawBadgeIconOverlay( |
| 766 *badge, | 766 *badge, |
| 767 kBadgeTextFontSize, | 767 kBadgeTextFontSize, |
| 768 badge_text, | 768 badge_text, |
| 769 l10n_util::GetStringUTF16(IDS_BACKGROUND_PAGE_BADGE_OVERFLOW)); | 769 l10n_util::GetStringUTF16(IDS_BACKGROUND_PAGE_BADGE_OVERFLOW)); |
| 770 } | 770 } |
| 771 | 771 |
| OLD | NEW |