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/system/locale/locale_notification_controller.h" | 5 #include "ash/system/locale/locale_notification_controller.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/system/system_notifier.h" | 10 #include "ash/system/system_notifier.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 base::string16 to = l10n_util::GetDisplayNameForLocale( | 94 base::string16 to = l10n_util::GetDisplayNameForLocale( |
95 to_locale, cur_locale, true); | 95 to_locale, cur_locale, true); |
96 | 96 |
97 message_center::RichNotificationData optional; | 97 message_center::RichNotificationData optional; |
98 optional.buttons.push_back(message_center::ButtonInfo( | 98 optional.buttons.push_back(message_center::ButtonInfo( |
99 l10n_util::GetStringFUTF16( | 99 l10n_util::GetStringFUTF16( |
100 IDS_ASH_STATUS_TRAY_LOCALE_REVERT_MESSAGE, from))); | 100 IDS_ASH_STATUS_TRAY_LOCALE_REVERT_MESSAGE, from))); |
101 optional.never_timeout = true; | 101 optional.never_timeout = true; |
102 | 102 |
103 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); | 103 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
104 scoped_ptr<Notification> notification(new Notification( | 104 std::unique_ptr<Notification> notification(new Notification( |
105 message_center::NOTIFICATION_TYPE_SIMPLE, kLocaleChangeNotificationId, | 105 message_center::NOTIFICATION_TYPE_SIMPLE, kLocaleChangeNotificationId, |
106 base::string16() /* title */, | 106 base::string16() /* title */, |
107 l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_LOCALE_CHANGE_MESSAGE, | 107 l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_LOCALE_CHANGE_MESSAGE, |
108 from, to), | 108 from, to), |
109 bundle.GetImageNamed(IDR_AURA_UBER_TRAY_LOCALE), | 109 bundle.GetImageNamed(IDR_AURA_UBER_TRAY_LOCALE), |
110 base::string16() /* display_source */, GURL(), | 110 base::string16() /* display_source */, GURL(), |
111 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, | 111 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, |
112 system_notifier::kNotifierLocale), | 112 system_notifier::kNotifierLocale), |
113 optional, new LocaleNotificationDelegate(delegate))); | 113 optional, new LocaleNotificationDelegate(delegate))); |
114 message_center::MessageCenter::Get()->AddNotification( | 114 message_center::MessageCenter::Get()->AddNotification( |
115 std::move(notification)); | 115 std::move(notification)); |
116 } | 116 } |
117 | 117 |
118 } // namespace ash | 118 } // namespace ash |
OLD | NEW |