| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_CHROMEOS_LOCALE_CHANGE_GUARD_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOCALE_CHANGE_GUARD_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOCALE_CHANGE_GUARD_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOCALE_CHANGE_GUARD_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "chrome/browser/chromeos/notifications/system_notification.h" | 13 #include "chrome/browser/chromeos/notifications/system_notification.h" |
| 14 #include "content/common/content_notification_types.h" |
| 14 #include "content/common/notification_observer.h" | 15 #include "content/common/notification_observer.h" |
| 15 #include "content/common/notification_registrar.h" | 16 #include "content/common/notification_registrar.h" |
| 16 #include "content/common/notification_type.h" | |
| 17 | 17 |
| 18 class ListValue; | 18 class ListValue; |
| 19 class NotificationDetails; | 19 class NotificationDetails; |
| 20 class NotificationSource; | 20 class NotificationSource; |
| 21 class Profile; | 21 class Profile; |
| 22 | 22 |
| 23 namespace chromeos { | 23 namespace chromeos { |
| 24 | 24 |
| 25 // Performs check whether locale has been changed automatically recently | 25 // Performs check whether locale has been changed automatically recently |
| 26 // (based on synchronized user preference). If so: shows notification that | 26 // (based on synchronized user preference). If so: shows notification that |
| (...skipping 11 matching lines...) Expand all Loading... |
| 38 void OnLogin(); | 38 void OnLogin(); |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 class Delegate; | 41 class Delegate; |
| 42 | 42 |
| 43 void RevertLocaleChange(const ListValue* list); | 43 void RevertLocaleChange(const ListValue* list); |
| 44 void AcceptLocaleChange(); | 44 void AcceptLocaleChange(); |
| 45 void Check(); | 45 void Check(); |
| 46 | 46 |
| 47 // NotificationObserver implementation. | 47 // NotificationObserver implementation. |
| 48 virtual void Observe(NotificationType type, | 48 virtual void Observe(int type, |
| 49 const NotificationSource& source, | 49 const NotificationSource& source, |
| 50 const NotificationDetails& details); | 50 const NotificationDetails& details); |
| 51 | 51 |
| 52 std::string from_locale_; | 52 std::string from_locale_; |
| 53 std::string to_locale_; | 53 std::string to_locale_; |
| 54 Profile* profile_; | 54 Profile* profile_; |
| 55 scoped_ptr<chromeos::SystemNotification> note_; | 55 scoped_ptr<chromeos::SystemNotification> note_; |
| 56 bool reverted_; | 56 bool reverted_; |
| 57 NotificationRegistrar registrar_; | 57 NotificationRegistrar registrar_; |
| 58 | 58 |
| 59 // We want to show locale change notification in previous language however | 59 // We want to show locale change notification in previous language however |
| 60 // we cannot directly load strings for non-current locale. So we cache | 60 // we cannot directly load strings for non-current locale. So we cache |
| 61 // messages before locale change. | 61 // messages before locale change. |
| 62 string16 title_text_; | 62 string16 title_text_; |
| 63 string16 message_text_; | 63 string16 message_text_; |
| 64 string16 revert_link_text_; | 64 string16 revert_link_text_; |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 } // namespace chromeos | 67 } // namespace chromeos |
| 68 | 68 |
| 69 #endif // CHROME_BROWSER_CHROMEOS_LOCALE_CHANGE_GUARD_H_ | 69 #endif // CHROME_BROWSER_CHROMEOS_LOCALE_CHANGE_GUARD_H_ |
| OLD | NEW |