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