OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/sync/sync_global_error.h" | 5 #include "chrome/browser/sync/sync_global_error.h" |
6 | 6 |
7 #include "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
8 #include "chrome/browser/sync/profile_sync_service.h" | 8 #include "chrome/browser/sync/profile_sync_service.h" |
9 #include "chrome/browser/sync/profile_sync_service_observer.h" | 9 #include "chrome/browser/sync/profile_sync_service_observer.h" |
10 #include "chrome/browser/sync/sync_ui_util.h" | 10 #include "chrome/browser/sync/sync_ui_util.h" |
11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
| 12 #include "chrome/browser/ui/browser_commands.h" |
12 #include "chrome/browser/ui/global_error_service.h" | 13 #include "chrome/browser/ui/global_error_service.h" |
13 #include "chrome/browser/ui/global_error_service_factory.h" | 14 #include "chrome/browser/ui/global_error_service_factory.h" |
14 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 15 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
15 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 16 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
16 #include "chrome/common/net/gaia/google_service_auth_error.h" | 17 #include "chrome/common/net/gaia/google_service_auth_error.h" |
17 #include "grit/chromium_strings.h" | 18 #include "grit/chromium_strings.h" |
18 #include "grit/generated_resources.h" | 19 #include "grit/generated_resources.h" |
19 #include "ui/base/l10n/l10n_util.h" | 20 #include "ui/base/l10n/l10n_util.h" |
20 | 21 |
21 typedef GoogleServiceAuthError AuthError; | 22 typedef GoogleServiceAuthError AuthError; |
(...skipping 30 matching lines...) Expand all Loading... |
52 } | 53 } |
53 | 54 |
54 string16 SyncGlobalError::MenuItemLabel() { | 55 string16 SyncGlobalError::MenuItemLabel() { |
55 return menu_label_; | 56 return menu_label_; |
56 } | 57 } |
57 | 58 |
58 void SyncGlobalError::ExecuteMenuItem(Browser* browser) { | 59 void SyncGlobalError::ExecuteMenuItem(Browser* browser) { |
59 #if defined(OS_CHROMEOS) | 60 #if defined(OS_CHROMEOS) |
60 if (service_->GetAuthError().state() != AuthError::NONE) { | 61 if (service_->GetAuthError().state() != AuthError::NONE) { |
61 DLOG(INFO) << "Signing out the user to fix a sync error."; | 62 DLOG(INFO) << "Signing out the user to fix a sync error."; |
62 browser->ExecuteCommand(IDC_EXIT); | 63 // TODO(beng): seems like this could just call browser::AttemptUserExit(). |
| 64 chrome::ExecuteCommand(browser, IDC_EXIT); |
63 return; | 65 return; |
64 } | 66 } |
65 #endif | 67 #endif |
66 LoginUIServiceFactory::GetForProfile(service_->profile())->ShowLoginUI(); | 68 LoginUIServiceFactory::GetForProfile(service_->profile())->ShowLoginUI(); |
67 } | 69 } |
68 | 70 |
69 bool SyncGlobalError::HasBubbleView() { | 71 bool SyncGlobalError::HasBubbleView() { |
70 return !bubble_message_.empty() && !bubble_accept_label_.empty(); | 72 return !bubble_message_.empty() && !bubble_accept_label_.empty(); |
71 } | 73 } |
72 | 74 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 if (profile) { | 123 if (profile) { |
122 GlobalErrorServiceFactory::GetForProfile( | 124 GlobalErrorServiceFactory::GetForProfile( |
123 profile)->NotifyErrorsChanged(this); | 125 profile)->NotifyErrorsChanged(this); |
124 } | 126 } |
125 } | 127 } |
126 } | 128 } |
127 | 129 |
128 bool SyncGlobalError::HasCustomizedSyncMenuItem() { | 130 bool SyncGlobalError::HasCustomizedSyncMenuItem() { |
129 return !menu_label_.empty(); | 131 return !menu_label_.empty(); |
130 } | 132 } |
OLD | NEW |