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 |
(...skipping 16 matching lines...) Expand all Loading... |
27 // allows user to revert change. | 27 // allows user to revert change. |
28 class LocaleChangeGuard : public NotificationObserver { | 28 class LocaleChangeGuard : public NotificationObserver { |
29 public: | 29 public: |
30 explicit LocaleChangeGuard(Profile* profile); | 30 explicit LocaleChangeGuard(Profile* profile); |
31 | 31 |
32 private: | 32 private: |
33 class Delegate; | 33 class Delegate; |
34 | 34 |
35 void RevertLocaleChange(const ListValue* list); | 35 void RevertLocaleChange(const ListValue* list); |
36 void AcceptLocaleChange(); | 36 void AcceptLocaleChange(); |
| 37 void Check(); |
37 | 38 |
38 // NotificationObserver implementation. | 39 // NotificationObserver implementation. |
39 virtual void Observe(NotificationType type, | 40 virtual void Observe(NotificationType type, |
40 const NotificationSource& source, | 41 const NotificationSource& source, |
41 const NotificationDetails& details); | 42 const NotificationDetails& details); |
42 | 43 |
43 std::string from_locale_; | 44 std::string from_locale_; |
44 std::string to_locale_; | 45 std::string to_locale_; |
45 Profile* profile_; | 46 Profile* profile_; |
46 scoped_ptr<chromeos::SystemNotification> note_; | 47 scoped_ptr<chromeos::SystemNotification> note_; |
47 bool reverted_; | 48 bool reverted_; |
48 NotificationRegistrar registrar_; | 49 NotificationRegistrar registrar_; |
49 }; | 50 }; |
50 | 51 |
51 } // namespace chromeos | 52 } // namespace chromeos |
52 | 53 |
53 #endif // CHROME_BROWSER_CHROMEOS_LOCALE_CHANGE_GUARD_H_ | 54 #endif // CHROME_BROWSER_CHROMEOS_LOCALE_CHANGE_GUARD_H_ |
OLD | NEW |