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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 return l10n_util::GetStringUTF16( | 233 return l10n_util::GetStringUTF16( |
239 IDS_SYNC_UNAVAILABLE_ERROR_BUBBLE_VIEW_MESSAGE); | 234 IDS_SYNC_UNAVAILABLE_ERROR_BUBBLE_VIEW_MESSAGE); |
240 break; | 235 break; |
241 | 236 |
242 // Generic message for "other" errors. | 237 // Generic message for "other" errors. |
243 default: | 238 default: |
244 return l10n_util::GetStringUTF16( | 239 return l10n_util::GetStringUTF16( |
245 IDS_SYNC_OTHER_SIGN_IN_ERROR_BUBBLE_VIEW_MESSAGE); | 240 IDS_SYNC_OTHER_SIGN_IN_ERROR_BUBBLE_VIEW_MESSAGE); |
246 } | 241 } |
247 } | 242 } |
OLD | NEW |