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 "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/system/system_notifier.h" | 8 #include "ash/system/system_notifier.h" |
9 #include "ash/system/tray/system_tray_notifier.h" | 9 #include "ash/system/tray/system_tray_notifier.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
11 #include "grit/ash_resources.h" | 11 #include "grit/ash_resources.h" |
12 #include "grit/ash_strings.h" | 12 #include "grit/ash_strings.h" |
13 #include "ui/base/l10n/l10n_util.h" | 13 #include "ui/base/l10n/l10n_util.h" |
14 #include "ui/base/resource/resource_bundle.h" | 14 #include "ui/base/resource/resource_bundle.h" |
15 #include "ui/message_center/message_center.h" | 15 #include "ui/message_center/message_center.h" |
16 #include "ui/message_center/notification.h" | 16 #include "ui/message_center/notification.h" |
17 #include "ui/message_center/notification_delegate.h" | 17 #include "ui/message_center/notification_delegate.h" |
18 #include "ui/message_center/notification_types.h" | 18 #include "ui/message_center/notification_types.h" |
19 | 19 |
20 using message_center::Notification; | 20 using message_center::Notification; |
21 | 21 |
22 namespace ash { | 22 namespace ash { |
23 namespace internal { | |
24 namespace { | 23 namespace { |
25 | 24 |
26 const char kLocaleChangeNotificationId[] = "chrome://settings/locale"; | 25 const char kLocaleChangeNotificationId[] = "chrome://settings/locale"; |
27 | 26 |
28 class LocaleNotificationDelegate : public message_center::NotificationDelegate { | 27 class LocaleNotificationDelegate : public message_center::NotificationDelegate { |
29 public: | 28 public: |
30 explicit LocaleNotificationDelegate(LocaleObserver::Delegate* delegate); | 29 explicit LocaleNotificationDelegate(LocaleObserver::Delegate* delegate); |
31 | 30 |
32 protected: | 31 protected: |
33 virtual ~LocaleNotificationDelegate(); | 32 virtual ~LocaleNotificationDelegate(); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 bundle.GetImageNamed(IDR_AURA_UBER_TRAY_LOCALE), | 117 bundle.GetImageNamed(IDR_AURA_UBER_TRAY_LOCALE), |
119 base::string16() /* display_source */, | 118 base::string16() /* display_source */, |
120 message_center::NotifierId( | 119 message_center::NotifierId( |
121 message_center::NotifierId::SYSTEM_COMPONENT, | 120 message_center::NotifierId::SYSTEM_COMPONENT, |
122 system_notifier::kNotifierLocale), | 121 system_notifier::kNotifierLocale), |
123 optional, | 122 optional, |
124 new LocaleNotificationDelegate(delegate))); | 123 new LocaleNotificationDelegate(delegate))); |
125 message_center::MessageCenter::Get()->AddNotification(notification.Pass()); | 124 message_center::MessageCenter::Get()->AddNotification(notification.Pass()); |
126 } | 125 } |
127 | 126 |
128 } // namespace internal | |
129 } // namespace ash | 127 } // namespace ash |
OLD | NEW |