| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/toolbar/toolbar_view.h" | 5 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/i18n/number_formatting.h" | 10 #include "base/i18n/number_formatting.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 #include "ui/views/widget/widget.h" | 72 #include "ui/views/widget/widget.h" |
| 73 #include "ui/views/window/non_client_view.h" | 73 #include "ui/views/window/non_client_view.h" |
| 74 | 74 |
| 75 #if defined(OS_WIN) | 75 #if defined(OS_WIN) |
| 76 #include "chrome/browser/recovery/recovery_install_global_error_factory.h" | 76 #include "chrome/browser/recovery/recovery_install_global_error_factory.h" |
| 77 #include "chrome/browser/ui/views/conflicting_module_view_win.h" | 77 #include "chrome/browser/ui/views/conflicting_module_view_win.h" |
| 78 #include "chrome/browser/ui/views/critical_notification_bubble_view.h" | 78 #include "chrome/browser/ui/views/critical_notification_bubble_view.h" |
| 79 #endif | 79 #endif |
| 80 | 80 |
| 81 #if !defined(OS_CHROMEOS) | 81 #if !defined(OS_CHROMEOS) |
| 82 #include "chrome/browser/signin/signin_global_error_factory.h" | |
| 83 #include "chrome/browser/sync/sync_global_error_factory.h" | 82 #include "chrome/browser/sync/sync_global_error_factory.h" |
| 84 #endif | 83 #endif |
| 85 | 84 |
| 86 #if defined(USE_ASH) | 85 #if defined(USE_ASH) |
| 87 #include "ash/shell.h" | 86 #include "ash/shell.h" |
| 88 #endif | 87 #endif |
| 89 | 88 |
| 90 using base::UserMetricsAction; | 89 using base::UserMetricsAction; |
| 91 using content::WebContents; | 90 using content::WebContents; |
| 92 | 91 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 AddChildView(forward_); | 212 AddChildView(forward_); |
| 214 AddChildView(reload_); | 213 AddChildView(reload_); |
| 215 AddChildView(home_); | 214 AddChildView(home_); |
| 216 AddChildView(location_bar_); | 215 AddChildView(location_bar_); |
| 217 AddChildView(browser_actions_); | 216 AddChildView(browser_actions_); |
| 218 AddChildView(app_menu_); | 217 AddChildView(app_menu_); |
| 219 | 218 |
| 220 LoadImages(); | 219 LoadImages(); |
| 221 | 220 |
| 222 // Start global error services now so we badge the menu correctly. | 221 // Start global error services now so we badge the menu correctly. |
| 223 #if !defined(OS_CHROMEOS) | 222 #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) |
| 224 if (!HasAshShell()) { | 223 if (!HasAshShell()) { |
| 225 SigninGlobalErrorFactory::GetForProfile(browser_->profile()); | |
| 226 #if !defined(OS_ANDROID) | |
| 227 SyncGlobalErrorFactory::GetForProfile(browser_->profile()); | 224 SyncGlobalErrorFactory::GetForProfile(browser_->profile()); |
| 225 } |
| 228 #endif | 226 #endif |
| 229 } | |
| 230 | 227 |
| 231 #if defined(OS_WIN) | 228 #if defined(OS_WIN) |
| 232 RecoveryInstallGlobalErrorFactory::GetForProfile(browser_->profile()); | 229 RecoveryInstallGlobalErrorFactory::GetForProfile(browser_->profile()); |
| 233 #endif | 230 #endif |
| 234 #endif // OS_CHROMEOS | |
| 235 | 231 |
| 236 // Add any necessary badges to the menu item based on the system state. | 232 // Add any necessary badges to the menu item based on the system state. |
| 237 // Do this after |app_menu_| has been added as a bubble may be shown that | 233 // Do this after |app_menu_| has been added as a bubble may be shown that |
| 238 // needs the widget (widget found by way of app_menu_->GetWidget()). | 234 // needs the widget (widget found by way of app_menu_->GetWidget()). |
| 239 badge_controller_.UpdateDelegate(); | 235 badge_controller_.UpdateDelegate(); |
| 240 | 236 |
| 241 location_bar_->Init(); | 237 location_bar_->Init(); |
| 242 | 238 |
| 243 show_home_button_.Init(prefs::kShowHomeButton, | 239 show_home_button_.Init(prefs::kShowHomeButton, |
| 244 browser_->profile()->GetPrefs(), | 240 browser_->profile()->GetPrefs(), |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 SchedulePaint(); | 836 SchedulePaint(); |
| 841 } | 837 } |
| 842 | 838 |
| 843 int ToolbarView::content_shadow_height() const { | 839 int ToolbarView::content_shadow_height() const { |
| 844 ui::ThemeProvider* theme_provider = GetThemeProvider(); | 840 ui::ThemeProvider* theme_provider = GetThemeProvider(); |
| 845 return theme_provider->GetDisplayProperty( | 841 return theme_provider->GetDisplayProperty( |
| 846 browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH | 842 browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH |
| 847 ? ThemeProperties::PROPERTY_TOOLBAR_VIEW_CONTENT_SHADOW_HEIGHT_ASH | 843 ? ThemeProperties::PROPERTY_TOOLBAR_VIEW_CONTENT_SHADOW_HEIGHT_ASH |
| 848 : ThemeProperties::PROPERTY_TOOLBAR_VIEW_CONTENT_SHADOW_HEIGHT); | 844 : ThemeProperties::PROPERTY_TOOLBAR_VIEW_CONTENT_SHADOW_HEIGHT); |
| 849 } | 845 } |
| OLD | NEW |