| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ash/display/display_error_observer_chromeos.h" | 5 #include "ash/display/display_error_observer_chromeos.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "ash/system/system_notifier.h" | 9 #include "ash/system/system_notifier.h" |
| 8 #include "grit/ash_resources.h" | 10 #include "grit/ash_resources.h" |
| 9 #include "grit/ash_strings.h" | 11 #include "grit/ash_strings.h" |
| 10 #include "ui/base/l10n/l10n_util.h" | 12 #include "ui/base/l10n/l10n_util.h" |
| 11 #include "ui/base/resource/resource_bundle.h" | 13 #include "ui/base/resource/resource_bundle.h" |
| 12 #include "ui/message_center/message_center.h" | 14 #include "ui/message_center/message_center.h" |
| 13 #include "ui/message_center/notification.h" | 15 #include "ui/message_center/notification.h" |
| 14 #include "ui/message_center/notification_delegate.h" | 16 #include "ui/message_center/notification_delegate.h" |
| 15 #include "ui/message_center/notification_list.h" | 17 #include "ui/message_center/notification_list.h" |
| 16 | 18 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 45 scoped_ptr<Notification> notification(new Notification( | 47 scoped_ptr<Notification> notification(new Notification( |
| 46 message_center::NOTIFICATION_TYPE_SIMPLE, kDisplayErrorNotificationId, | 48 message_center::NOTIFICATION_TYPE_SIMPLE, kDisplayErrorNotificationId, |
| 47 base::string16(), // title | 49 base::string16(), // title |
| 48 l10n_util::GetStringUTF16(message_id), | 50 l10n_util::GetStringUTF16(message_id), |
| 49 bundle.GetImageNamed(IDR_AURA_NOTIFICATION_DISPLAY), | 51 bundle.GetImageNamed(IDR_AURA_NOTIFICATION_DISPLAY), |
| 50 base::string16(), // display_source | 52 base::string16(), // display_source |
| 51 GURL(), | 53 GURL(), |
| 52 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, | 54 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, |
| 53 system_notifier::kNotifierDisplayError), | 55 system_notifier::kNotifierDisplayError), |
| 54 message_center::RichNotificationData(), NULL)); | 56 message_center::RichNotificationData(), NULL)); |
| 55 message_center::MessageCenter::Get()->AddNotification(notification.Pass()); | 57 message_center::MessageCenter::Get()->AddNotification( |
| 58 std::move(notification)); |
| 56 } | 59 } |
| 57 | 60 |
| 58 base::string16 | 61 base::string16 |
| 59 DisplayErrorObserver::GetDisplayErrorNotificationMessageForTest() { | 62 DisplayErrorObserver::GetDisplayErrorNotificationMessageForTest() { |
| 60 message_center::NotificationList::Notifications notifications = | 63 message_center::NotificationList::Notifications notifications = |
| 61 message_center::MessageCenter::Get()->GetVisibleNotifications(); | 64 message_center::MessageCenter::Get()->GetVisibleNotifications(); |
| 62 for (message_center::NotificationList::Notifications::const_iterator iter = | 65 for (message_center::NotificationList::Notifications::const_iterator iter = |
| 63 notifications.begin(); iter != notifications.end(); ++iter) { | 66 notifications.begin(); iter != notifications.end(); ++iter) { |
| 64 if ((*iter)->id() == kDisplayErrorNotificationId) | 67 if ((*iter)->id() == kDisplayErrorNotificationId) |
| 65 return (*iter)->message(); | 68 return (*iter)->message(); |
| 66 } | 69 } |
| 67 | 70 |
| 68 return base::string16(); | 71 return base::string16(); |
| 69 } | 72 } |
| 70 | 73 |
| 71 } // namespace ash | 74 } // namespace ash |
| OLD | NEW |