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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 const char kProfileSigninNotificationId[] = "chrome://settings/signin/"; | 44 const char kProfileSigninNotificationId[] = "chrome://settings/signin/"; |
45 | 45 |
46 // A notification delegate for the sign-out button. | 46 // A notification delegate for the sign-out button. |
47 class SigninNotificationDelegate : public NotificationDelegate { | 47 class SigninNotificationDelegate : public NotificationDelegate { |
48 public: | 48 public: |
49 SigninNotificationDelegate(const std::string& id, | 49 SigninNotificationDelegate(const std::string& id, |
50 Profile* profile); | 50 Profile* profile); |
51 | 51 |
52 // NotificationDelegate: | 52 // NotificationDelegate: |
53 void Display() override; | |
54 void Error() override; | |
55 void Close(bool by_user) override; | |
56 bool HasClickedListener() override; | |
57 void Click() override; | 53 void Click() override; |
58 void ButtonClick(int button_index) override; | 54 void ButtonClick(int button_index) override; |
59 std::string id() const override; | 55 std::string id() const override; |
60 | 56 |
61 protected: | 57 protected: |
62 ~SigninNotificationDelegate() override; | 58 ~SigninNotificationDelegate() override; |
63 | 59 |
64 private: | 60 private: |
65 void FixSignIn(); | 61 void FixSignIn(); |
66 | 62 |
67 // Unique id of the notification. | 63 // Unique id of the notification. |
68 const std::string id_; | 64 const std::string id_; |
69 | 65 |
70 Profile* profile_; | 66 Profile* profile_; |
71 | 67 |
72 DISALLOW_COPY_AND_ASSIGN(SigninNotificationDelegate); | 68 DISALLOW_COPY_AND_ASSIGN(SigninNotificationDelegate); |
73 }; | 69 }; |
74 | 70 |
75 SigninNotificationDelegate::SigninNotificationDelegate( | 71 SigninNotificationDelegate::SigninNotificationDelegate( |
76 const std::string& id, | 72 const std::string& id, |
77 Profile* profile) | 73 Profile* profile) |
78 : id_(id), | 74 : id_(id), |
79 profile_(profile) { | 75 profile_(profile) { |
80 } | 76 } |
81 | 77 |
82 SigninNotificationDelegate::~SigninNotificationDelegate() { | 78 SigninNotificationDelegate::~SigninNotificationDelegate() { |
83 } | 79 } |
84 | 80 |
85 void SigninNotificationDelegate::Display() { | |
86 } | |
87 | |
88 void SigninNotificationDelegate::Error() { | |
89 } | |
90 | |
91 void SigninNotificationDelegate::Close(bool by_user) { | |
92 } | |
93 | |
94 bool SigninNotificationDelegate::HasClickedListener() { | |
95 return false; | |
96 } | |
97 | |
98 void SigninNotificationDelegate::Click() { | 81 void SigninNotificationDelegate::Click() { |
99 FixSignIn(); | 82 FixSignIn(); |
100 } | 83 } |
101 | 84 |
102 void SigninNotificationDelegate::ButtonClick(int button_index) { | 85 void SigninNotificationDelegate::ButtonClick(int button_index) { |
103 FixSignIn(); | 86 FixSignIn(); |
104 } | 87 } |
105 | 88 |
106 std::string SigninNotificationDelegate::id() const { | 89 std::string SigninNotificationDelegate::id() const { |
107 return id_; | 90 return id_; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 return l10n_util::GetStringUTF16( | 216 return l10n_util::GetStringUTF16( |
234 IDS_SYNC_UNAVAILABLE_ERROR_BUBBLE_VIEW_MESSAGE); | 217 IDS_SYNC_UNAVAILABLE_ERROR_BUBBLE_VIEW_MESSAGE); |
235 break; | 218 break; |
236 | 219 |
237 // Generic message for "other" errors. | 220 // Generic message for "other" errors. |
238 default: | 221 default: |
239 return l10n_util::GetStringUTF16( | 222 return l10n_util::GetStringUTF16( |
240 IDS_SYNC_OTHER_SIGN_IN_ERROR_BUBBLE_VIEW_MESSAGE); | 223 IDS_SYNC_OTHER_SIGN_IN_ERROR_BUBBLE_VIEW_MESSAGE); |
241 } | 224 } |
242 } | 225 } |
OLD | NEW |