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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 Profile* profile); | 50 Profile* profile); |
51 | 51 |
52 // NotificationDelegate: | 52 // NotificationDelegate: |
53 virtual void Display() OVERRIDE; | 53 virtual void Display() OVERRIDE; |
54 virtual void Error() OVERRIDE; | 54 virtual void Error() OVERRIDE; |
55 virtual void Close(bool by_user) OVERRIDE; | 55 virtual void Close(bool by_user) OVERRIDE; |
56 virtual bool HasClickedListener() OVERRIDE; | 56 virtual bool HasClickedListener() OVERRIDE; |
57 virtual void Click() OVERRIDE; | 57 virtual void Click() OVERRIDE; |
58 virtual void ButtonClick(int button_index) OVERRIDE; | 58 virtual void ButtonClick(int button_index) OVERRIDE; |
59 virtual std::string id() const OVERRIDE; | 59 virtual std::string id() const OVERRIDE; |
60 virtual content::WebContents* GetWebContents() const OVERRIDE; | |
61 | 60 |
62 protected: | 61 protected: |
63 virtual ~SigninNotificationDelegate(); | 62 virtual ~SigninNotificationDelegate(); |
64 | 63 |
65 private: | 64 private: |
66 void FixSignIn(); | 65 void FixSignIn(); |
67 | 66 |
68 // Unique id of the notification. | 67 // Unique id of the notification. |
69 const std::string id_; | 68 const std::string id_; |
70 | 69 |
(...skipping 30 matching lines...) Expand all Loading... |
101 } | 100 } |
102 | 101 |
103 void SigninNotificationDelegate::ButtonClick(int button_index) { | 102 void SigninNotificationDelegate::ButtonClick(int button_index) { |
104 FixSignIn(); | 103 FixSignIn(); |
105 } | 104 } |
106 | 105 |
107 std::string SigninNotificationDelegate::id() const { | 106 std::string SigninNotificationDelegate::id() const { |
108 return id_; | 107 return id_; |
109 } | 108 } |
110 | 109 |
111 content::WebContents* SigninNotificationDelegate::GetWebContents() const { | |
112 return NULL; | |
113 } | |
114 | |
115 void SigninNotificationDelegate::FixSignIn() { | 110 void SigninNotificationDelegate::FixSignIn() { |
116 #if defined(OS_CHROMEOS) | 111 #if defined(OS_CHROMEOS) |
117 chrome::AttemptUserExit(); | 112 chrome::AttemptUserExit(); |
118 #else | 113 #else |
119 LoginUIService* login_ui = LoginUIServiceFactory::GetForProfile(profile_); | 114 LoginUIService* login_ui = LoginUIServiceFactory::GetForProfile(profile_); |
120 if (login_ui->current_login_ui()) { | 115 if (login_ui->current_login_ui()) { |
121 login_ui->current_login_ui()->FocusUI(); | 116 login_ui->current_login_ui()->FocusUI(); |
122 return; | 117 return; |
123 } | 118 } |
124 | 119 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 return l10n_util::GetStringUTF16( | 231 return l10n_util::GetStringUTF16( |
237 IDS_SYNC_UNAVAILABLE_ERROR_BUBBLE_VIEW_MESSAGE); | 232 IDS_SYNC_UNAVAILABLE_ERROR_BUBBLE_VIEW_MESSAGE); |
238 break; | 233 break; |
239 | 234 |
240 // Generic message for "other" errors. | 235 // Generic message for "other" errors. |
241 default: | 236 default: |
242 return l10n_util::GetStringUTF16( | 237 return l10n_util::GetStringUTF16( |
243 IDS_SYNC_OTHER_SIGN_IN_ERROR_BUBBLE_VIEW_MESSAGE); | 238 IDS_SYNC_OTHER_SIGN_IN_ERROR_BUBBLE_VIEW_MESSAGE); |
244 } | 239 } |
245 } | 240 } |
OLD | NEW |