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_MOCK_INPUT_METHOD_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_MANAGER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_MANAGER_H_ |
7 | 7 |
8 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 8 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
9 #include "chromeos/ime/component_extension_ime_manager.h" | 9 #include "chromeos/ime/component_extension_ime_manager.h" |
10 #include "chromeos/ime/fake_ime_keyboard.h" | 10 #include "chromeos/ime/fake_ime_keyboard.h" |
11 #include "chromeos/ime/fake_input_method_delegate.h" | 11 #include "chromeos/ime/fake_input_method_delegate.h" |
12 #include "chromeos/ime/input_method_manager.h" | 12 #include "chromeos/ime/input_method_manager.h" |
13 #include "chromeos/ime/input_method_whitelist.h" | 13 #include "chromeos/ime/input_method_whitelist.h" |
14 | 14 |
15 namespace chromeos { | 15 namespace chromeos { |
16 namespace input_method { | 16 namespace input_method { |
17 | 17 |
18 // The mock implementation of InputMethodManager for testing. | 18 // The mock implementation of InputMethodManager for testing. |
19 class MockInputMethodManager : public InputMethodManager { | 19 class MockInputMethodManager : public InputMethodManager { |
20 public: | 20 public: |
| 21 class State : public InputMethodManager::State { |
| 22 public: |
| 23 State(); |
| 24 |
| 25 protected: |
| 26 friend base::RefCounted<chromeos::input_method::InputMethodManager::State>; |
| 27 virtual ~State(); |
| 28 }; |
| 29 |
21 MockInputMethodManager(); | 30 MockInputMethodManager(); |
22 virtual ~MockInputMethodManager(); | 31 virtual ~MockInputMethodManager(); |
23 | 32 |
24 // InputMethodManager override: | 33 // InputMethodManager override: |
25 virtual void AddObserver(InputMethodManager::Observer* observer) OVERRIDE; | 34 virtual void AddObserver(InputMethodManager::Observer* observer) OVERRIDE; |
26 virtual void AddCandidateWindowObserver( | 35 virtual void AddCandidateWindowObserver( |
27 InputMethodManager::CandidateWindowObserver* observer) OVERRIDE; | 36 InputMethodManager::CandidateWindowObserver* observer) OVERRIDE; |
28 virtual void RemoveObserver(InputMethodManager::Observer* observer) OVERRIDE; | 37 virtual void RemoveObserver(InputMethodManager::Observer* observer) OVERRIDE; |
29 virtual void RemoveCandidateWindowObserver( | 38 virtual void RemoveCandidateWindowObserver( |
30 InputMethodManager::CandidateWindowObserver* observer) OVERRIDE; | 39 InputMethodManager::CandidateWindowObserver* observer) OVERRIDE; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 virtual bool IsISOLevel5ShiftUsedByCurrentInputMethod() const OVERRIDE; | 73 virtual bool IsISOLevel5ShiftUsedByCurrentInputMethod() const OVERRIDE; |
65 virtual bool IsAltGrUsedByCurrentInputMethod() const OVERRIDE; | 74 virtual bool IsAltGrUsedByCurrentInputMethod() const OVERRIDE; |
66 virtual ImeKeyboard* GetImeKeyboard() OVERRIDE; | 75 virtual ImeKeyboard* GetImeKeyboard() OVERRIDE; |
67 virtual InputMethodUtil* GetInputMethodUtil() OVERRIDE; | 76 virtual InputMethodUtil* GetInputMethodUtil() OVERRIDE; |
68 virtual ComponentExtensionIMEManager* | 77 virtual ComponentExtensionIMEManager* |
69 GetComponentExtensionIMEManager() OVERRIDE; | 78 GetComponentExtensionIMEManager() OVERRIDE; |
70 virtual bool IsLoginKeyboard(const std::string& layout) const OVERRIDE; | 79 virtual bool IsLoginKeyboard(const std::string& layout) const OVERRIDE; |
71 virtual bool MigrateInputMethods( | 80 virtual bool MigrateInputMethods( |
72 std::vector<std::string>* input_method_ids) OVERRIDE; | 81 std::vector<std::string>* input_method_ids) OVERRIDE; |
73 | 82 |
| 83 virtual scoped_refptr<InputMethodManager::State> CreateNewState( |
| 84 const std::string& debug_name) const OVERRIDE; |
| 85 virtual void SetState( |
| 86 scoped_refptr<InputMethodManager::State> state) OVERRIDE; |
| 87 |
74 // Sets an input method ID which will be returned by GetCurrentInputMethod(). | 88 // Sets an input method ID which will be returned by GetCurrentInputMethod(). |
75 void SetCurrentInputMethodId(const std::string& input_method_id) { | 89 void SetCurrentInputMethodId(const std::string& input_method_id) { |
76 current_input_method_id_ = input_method_id; | 90 current_input_method_id_ = input_method_id; |
77 } | 91 } |
78 | 92 |
79 void SetComponentExtensionIMEManager( | 93 void SetComponentExtensionIMEManager( |
80 scoped_ptr<ComponentExtensionIMEManager> comp_ime_manager); | 94 scoped_ptr<ComponentExtensionIMEManager> comp_ime_manager); |
81 | 95 |
82 // Set values that will be provided to the InputMethodUtil. | 96 // Set values that will be provided to the InputMethodUtil. |
83 void set_application_locale(const std::string& value); | 97 void set_application_locale(const std::string& value); |
(...skipping 19 matching lines...) Expand all Loading... |
103 // The active input method ids cache (actually default only) | 117 // The active input method ids cache (actually default only) |
104 std::vector<std::string> active_input_method_ids_; | 118 std::vector<std::string> active_input_method_ids_; |
105 | 119 |
106 DISALLOW_COPY_AND_ASSIGN(MockInputMethodManager); | 120 DISALLOW_COPY_AND_ASSIGN(MockInputMethodManager); |
107 }; | 121 }; |
108 | 122 |
109 } // namespace input_method | 123 } // namespace input_method |
110 } // namespace chromeos | 124 } // namespace chromeos |
111 | 125 |
112 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_MANAGER_H_ | 126 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_MANAGER_H_ |
OLD | NEW |