| 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/compiler_specific.h" |
| 11 #include "base/lazy_instance.h" | 12 #include "base/lazy_instance.h" |
| 12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 14 #include "chrome/browser/chromeos/notifications/system_notification.h" | 15 #include "chrome/browser/chromeos/notifications/system_notification.h" |
| 15 #include "content/public/browser/notification_observer.h" | 16 #include "content/public/browser/notification_observer.h" |
| 16 #include "content/public/browser/notification_registrar.h" | 17 #include "content/public/browser/notification_registrar.h" |
| 17 #include "content/public/browser/notification_types.h" | 18 #include "content/public/browser/notification_types.h" |
| 18 | 19 |
| 19 class Profile; | 20 class Profile; |
| 20 | 21 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 43 private: | 44 private: |
| 44 class Delegate; | 45 class Delegate; |
| 45 | 46 |
| 46 void RevertLocaleChange(const base::ListValue* list); | 47 void RevertLocaleChange(const base::ListValue* list); |
| 47 void AcceptLocaleChange(); | 48 void AcceptLocaleChange(); |
| 48 void Check(); | 49 void Check(); |
| 49 | 50 |
| 50 // content::NotificationObserver implementation. | 51 // content::NotificationObserver implementation. |
| 51 virtual void Observe(int type, | 52 virtual void Observe(int type, |
| 52 const content::NotificationSource& source, | 53 const content::NotificationSource& source, |
| 53 const content::NotificationDetails& details); | 54 const content::NotificationDetails& details) OVERRIDE; |
| 54 | 55 |
| 55 std::string from_locale_; | 56 std::string from_locale_; |
| 56 std::string to_locale_; | 57 std::string to_locale_; |
| 57 Profile* profile_; | 58 Profile* profile_; |
| 58 scoped_ptr<chromeos::SystemNotification> note_; | 59 scoped_ptr<chromeos::SystemNotification> note_; |
| 59 bool reverted_; | 60 bool reverted_; |
| 60 content::NotificationRegistrar registrar_; | 61 content::NotificationRegistrar registrar_; |
| 61 | 62 |
| 62 // We want to show locale change notification in previous language however | 63 // We want to show locale change notification in previous language however |
| 63 // we cannot directly load strings for non-current locale. So we cache | 64 // we cannot directly load strings for non-current locale. So we cache |
| 64 // messages before locale change. | 65 // messages before locale change. |
| 65 string16 title_text_; | 66 string16 title_text_; |
| 66 string16 message_text_; | 67 string16 message_text_; |
| 67 string16 revert_link_text_; | 68 string16 revert_link_text_; |
| 68 }; | 69 }; |
| 69 | 70 |
| 70 } // namespace chromeos | 71 } // namespace chromeos |
| 71 | 72 |
| 72 #endif // CHROME_BROWSER_CHROMEOS_LOCALE_CHANGE_GUARD_H_ | 73 #endif // CHROME_BROWSER_CHROMEOS_LOCALE_CHANGE_GUARD_H_ |
| OLD | NEW |