Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / chromeos / input_method / input_method_persistence.h
blob9e199214d9ae5e486371aa9e76e1c7bc51f3da76
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_PERSISTENCE_H_
6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_PERSISTENCE_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "chromeos/ime/input_method_manager.h"
14 namespace chromeos {
15 namespace 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,
19 // according to the session state.
20 class InputMethodPersistence : public InputMethodManager::Observer {
21 public:
22 // Constructs an instance that will observe input method changes on the
23 // provided InputMethodManager. The client is responsible for calling
24 // OnSessionStateChange whenever the InputMethodManager::State changes.
25 explicit InputMethodPersistence(InputMethodManager* input_method_manager);
26 virtual ~InputMethodPersistence();
28 // Receives notification of session state changes.
29 void OnSessionStateChange(InputMethodManager::State new_state);
31 // InputMethodManager::Observer overrides.
32 virtual void InputMethodChanged(InputMethodManager* manager,
33 bool show_message) OVERRIDE;
34 virtual void InputMethodPropertyChanged(InputMethodManager* manager) OVERRIDE;
36 private:
37 InputMethodManager* input_method_manager_;
38 InputMethodManager::State state_;
39 DISALLOW_COPY_AND_ASSIGN(InputMethodPersistence);
42 } // namespace input_method
43 } // namespace chromeos
45 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_PERSISTENCE_H_