OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/signin/signin_error_notifier_ash.h" | 5 #include "chrome/browser/signin/signin_error_notifier_ash.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_delegate.h" | 8 #include "ash/shell_delegate.h" |
9 #include "ash/system/system_notifier.h" | 9 #include "ash/system/system_notifier.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "grit/generated_resources.h" | 28 #include "grit/generated_resources.h" |
29 #include "grit/theme_resources.h" | 29 #include "grit/theme_resources.h" |
30 #include "third_party/WebKit/public/web/WebTextDirection.h" | 30 #include "third_party/WebKit/public/web/WebTextDirection.h" |
31 #include "ui/base/l10n/l10n_util.h" | 31 #include "ui/base/l10n/l10n_util.h" |
32 #include "ui/base/resource/resource_bundle.h" | 32 #include "ui/base/resource/resource_bundle.h" |
33 #include "ui/message_center/notification.h" | 33 #include "ui/message_center/notification.h" |
34 #include "ui/message_center/notification_delegate.h" | 34 #include "ui/message_center/notification_delegate.h" |
35 | 35 |
36 #if defined(OS_CHROMEOS) | 36 #if defined(OS_CHROMEOS) |
37 #include "chrome/browser/chromeos/login/user_flow.h" | 37 #include "chrome/browser/chromeos/login/user_flow.h" |
38 #include "chrome/browser/chromeos/login/users/user_manager.h" | 38 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
| 39 #include "components/user_manager/user_manager.h" |
39 #endif | 40 #endif |
40 | 41 |
41 namespace { | 42 namespace { |
42 | 43 |
43 const char kProfileSigninNotificationId[] = "chrome://settings/signin/"; | 44 const char kProfileSigninNotificationId[] = "chrome://settings/signin/"; |
44 | 45 |
45 // A notification delegate for the sign-out button. | 46 // A notification delegate for the sign-out button. |
46 class SigninNotificationDelegate : public NotificationDelegate { | 47 class SigninNotificationDelegate : public NotificationDelegate { |
47 public: | 48 public: |
48 SigninNotificationDelegate(const std::string& id, | 49 SigninNotificationDelegate(const std::string& id, |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 // notification_ui_manager() may return NULL when shutting down. | 162 // notification_ui_manager() may return NULL when shutting down. |
162 if (!notification_ui_manager) | 163 if (!notification_ui_manager) |
163 return; | 164 return; |
164 | 165 |
165 if (!error_controller_->HasError()) { | 166 if (!error_controller_->HasError()) { |
166 g_browser_process->notification_ui_manager()->CancelById(notification_id_); | 167 g_browser_process->notification_ui_manager()->CancelById(notification_id_); |
167 return; | 168 return; |
168 } | 169 } |
169 | 170 |
170 #if defined(OS_CHROMEOS) | 171 #if defined(OS_CHROMEOS) |
171 if (chromeos::UserManager::IsInitialized()) { | 172 if (user_manager::UserManager::IsInitialized()) { |
172 chromeos::UserFlow* user_flow = | 173 chromeos::UserFlow* user_flow = |
173 chromeos::UserManager::Get()->GetCurrentUserFlow(); | 174 chromeos::ChromeUserManager::Get()->GetCurrentUserFlow(); |
174 | 175 |
175 // Check whether Chrome OS user flow allows launching browser. | 176 // Check whether Chrome OS user flow allows launching browser. |
176 // Example: Supervised user creation flow which handles token invalidation | 177 // Example: Supervised user creation flow which handles token invalidation |
177 // itself and notifications should be suppressed. http://crbug.com/359045 | 178 // itself and notifications should be suppressed. http://crbug.com/359045 |
178 if (!user_flow->ShouldLaunchBrowser()) | 179 if (!user_flow->ShouldLaunchBrowser()) |
179 return; | 180 return; |
180 } | 181 } |
181 #endif | 182 #endif |
182 | 183 |
183 // Add an accept button to sign the user out. | 184 // Add an accept button to sign the user out. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 return l10n_util::GetStringUTF16( | 236 return l10n_util::GetStringUTF16( |
236 IDS_SYNC_UNAVAILABLE_ERROR_BUBBLE_VIEW_MESSAGE); | 237 IDS_SYNC_UNAVAILABLE_ERROR_BUBBLE_VIEW_MESSAGE); |
237 break; | 238 break; |
238 | 239 |
239 // Generic message for "other" errors. | 240 // Generic message for "other" errors. |
240 default: | 241 default: |
241 return l10n_util::GetStringUTF16( | 242 return l10n_util::GetStringUTF16( |
242 IDS_SYNC_OTHER_SIGN_IN_ERROR_BUBBLE_VIEW_MESSAGE); | 243 IDS_SYNC_OTHER_SIGN_IN_ERROR_BUBBLE_VIEW_MESSAGE); |
243 } | 244 } |
244 } | 245 } |
OLD | NEW |