OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_INPUT_METHOD_INPUT_METHOD_PERSISTENCE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_PERSISTENCE_H_ |
6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_PERSISTENCE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_PERSISTENCE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "chromeos/ime/input_method_manager.h" | 12 #include "chromeos/ime/input_method_manager.h" |
13 | 13 |
14 namespace chromeos { | 14 namespace chromeos { |
15 namespace input_method { | 15 namespace input_method { |
16 | 16 |
17 // Observes input method and session state changes, and persists input method | 17 // Observes input method and session state changes, and persists input method |
18 // changes to the BrowserProcess local state or to the user preferences, | 18 // changes to the BrowserProcess local state or to the user preferences, |
19 // according to the session state. | 19 // according to the session state. |
20 class InputMethodPersistence : public InputMethodManager::Observer { | 20 class InputMethodPersistence : public InputMethodManager::Observer { |
21 public: | 21 public: |
22 // Constructs an instance that will observe input method changes on the | 22 // Constructs an instance that will observe input method changes on the |
23 // provided InputMethodManager. The client is responsible for calling | 23 // provided InputMethodManager. The client is responsible for calling |
24 // OnSessionStateChange whenever the InputMethodManager::State changes. | 24 // OnSessionStateChange whenever the InputMethodManager::UIState changes. |
25 explicit InputMethodPersistence(InputMethodManager* input_method_manager); | 25 explicit InputMethodPersistence(InputMethodManager* input_method_manager); |
26 virtual ~InputMethodPersistence(); | 26 virtual ~InputMethodPersistence(); |
27 | 27 |
28 // Receives notification of session state changes. | 28 // Receives notification of session state changes. |
29 void OnSessionStateChange(InputMethodManager::State new_state); | 29 void OnSessionStateChange(InputMethodManager::UIState new_state); |
30 | 30 |
31 // InputMethodManager::Observer overrides. | 31 // InputMethodManager::Observer overrides. |
32 virtual void InputMethodChanged(InputMethodManager* manager, | 32 virtual void InputMethodChanged(InputMethodManager* manager, |
33 bool show_message) OVERRIDE; | 33 bool show_message) OVERRIDE; |
34 | 34 |
35 private: | 35 private: |
36 InputMethodManager* input_method_manager_; | 36 InputMethodManager* input_method_manager_; |
37 InputMethodManager::State state_; | 37 InputMethodManager::UIState ui_state_; |
38 DISALLOW_COPY_AND_ASSIGN(InputMethodPersistence); | 38 DISALLOW_COPY_AND_ASSIGN(InputMethodPersistence); |
39 }; | 39 }; |
40 | 40 |
41 } // namespace input_method | 41 } // namespace input_method |
42 } // namespace chromeos | 42 } // namespace chromeos |
43 | 43 |
44 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_PERSISTENCE_H_ | 44 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_PERSISTENCE_H_ |
OLD | NEW |