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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 | 172 |
173 message_center::NotifierId notifier_id( | 173 message_center::NotifierId notifier_id( |
174 message_center::NotifierId::SYSTEM_COMPONENT, | 174 message_center::NotifierId::SYSTEM_COMPONENT, |
175 kProfileSigninNotificationId); | 175 kProfileSigninNotificationId); |
176 | 176 |
177 // Set |profile_id| for multi-user notification blocker. | 177 // Set |profile_id| for multi-user notification blocker. |
178 notifier_id.profile_id = multi_user_util::GetUserIDFromProfile(profile_); | 178 notifier_id.profile_id = multi_user_util::GetUserIDFromProfile(profile_); |
179 | 179 |
180 Notification notification( | 180 Notification notification( |
181 message_center::NOTIFICATION_TYPE_SIMPLE, | 181 message_center::NOTIFICATION_TYPE_SIMPLE, |
182 GURL(notification_id_), | |
183 l10n_util::GetStringUTF16(IDS_SIGNIN_ERROR_BUBBLE_VIEW_TITLE), | 182 l10n_util::GetStringUTF16(IDS_SIGNIN_ERROR_BUBBLE_VIEW_TITLE), |
184 GetMessageBody(), | 183 GetMessageBody(), ui::ResourceBundle::GetSharedInstance().GetImageNamed( |
185 ui::ResourceBundle::GetSharedInstance().GetImageNamed( | 184 IDR_NOTIFICATION_ALERT), |
186 IDR_NOTIFICATION_ALERT), | |
187 notifier_id, | 185 notifier_id, |
188 base::string16(), // display_source | 186 base::string16(), // display_source |
189 notification_id_, | 187 GURL(notification_id_), notification_id_, data, delegate); |
190 data, | |
191 delegate); | |
192 | 188 |
193 // Update or add the notification. | 189 // Update or add the notification. |
194 if (notification_ui_manager->FindById( | 190 if (notification_ui_manager->FindById( |
195 notification_id_, NotificationUIManager::GetProfileID(profile_))) | 191 notification_id_, NotificationUIManager::GetProfileID(profile_))) |
196 notification_ui_manager->Update(notification, profile_); | 192 notification_ui_manager->Update(notification, profile_); |
197 else | 193 else |
198 notification_ui_manager->Add(notification, profile_); | 194 notification_ui_manager->Add(notification, profile_); |
199 } | 195 } |
200 | 196 |
201 base::string16 SigninErrorNotifier::GetMessageBody() const { | 197 base::string16 SigninErrorNotifier::GetMessageBody() const { |
(...skipping 14 matching lines...) Expand all Loading... |
216 return l10n_util::GetStringUTF16( | 212 return l10n_util::GetStringUTF16( |
217 IDS_SYNC_UNAVAILABLE_ERROR_BUBBLE_VIEW_MESSAGE); | 213 IDS_SYNC_UNAVAILABLE_ERROR_BUBBLE_VIEW_MESSAGE); |
218 break; | 214 break; |
219 | 215 |
220 // Generic message for "other" errors. | 216 // Generic message for "other" errors. |
221 default: | 217 default: |
222 return l10n_util::GetStringUTF16( | 218 return l10n_util::GetStringUTF16( |
223 IDS_SYNC_OTHER_SIGN_IN_ERROR_BUBBLE_VIEW_MESSAGE); | 219 IDS_SYNC_OTHER_SIGN_IN_ERROR_BUBBLE_VIEW_MESSAGE); |
224 } | 220 } |
225 } | 221 } |
OLD | NEW |