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 MockInputMethodManager(); | 21 MockInputMethodManager(); |
22 virtual ~MockInputMethodManager(); | 22 virtual ~MockInputMethodManager(); |
23 | 23 |
24 // InputMethodManager override: | 24 // InputMethodManager override: |
| 25 virtual void InitializeComponentExtension() OVERRIDE; |
25 virtual void AddObserver(InputMethodManager::Observer* observer) OVERRIDE; | 26 virtual void AddObserver(InputMethodManager::Observer* observer) OVERRIDE; |
26 virtual void AddCandidateWindowObserver( | 27 virtual void AddCandidateWindowObserver( |
27 InputMethodManager::CandidateWindowObserver* observer) OVERRIDE; | 28 InputMethodManager::CandidateWindowObserver* observer) OVERRIDE; |
28 virtual void RemoveObserver(InputMethodManager::Observer* observer) OVERRIDE; | 29 virtual void RemoveObserver(InputMethodManager::Observer* observer) OVERRIDE; |
29 virtual void RemoveCandidateWindowObserver( | 30 virtual void RemoveCandidateWindowObserver( |
30 InputMethodManager::CandidateWindowObserver* observer) OVERRIDE; | 31 InputMethodManager::CandidateWindowObserver* observer) OVERRIDE; |
31 virtual scoped_ptr<InputMethodDescriptors> | 32 virtual scoped_ptr<InputMethodDescriptors> |
32 GetSupportedInputMethods() const OVERRIDE; | 33 GetSupportedInputMethods() const OVERRIDE; |
33 virtual scoped_ptr<InputMethodDescriptors> | 34 virtual scoped_ptr<InputMethodDescriptors> |
34 GetActiveInputMethods() const OVERRIDE; | 35 GetActiveInputMethods() const OVERRIDE; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 void set_mod3_used(bool value) { mod3_used_ = value; } | 87 void set_mod3_used(bool value) { mod3_used_ = value; } |
87 | 88 |
88 // TODO(yusukes): Add more variables for counting the numbers of the API calls | 89 // TODO(yusukes): Add more variables for counting the numbers of the API calls |
89 int add_observer_count_; | 90 int add_observer_count_; |
90 int remove_observer_count_; | 91 int remove_observer_count_; |
91 | 92 |
92 private: | 93 private: |
93 // The value GetCurrentInputMethod().id() will return. | 94 // The value GetCurrentInputMethod().id() will return. |
94 std::string current_input_method_id_; | 95 std::string current_input_method_id_; |
95 | 96 |
96 InputMethodWhitelist whitelist_; | |
97 FakeInputMethodDelegate delegate_; // used by util_ | 97 FakeInputMethodDelegate delegate_; // used by util_ |
98 InputMethodUtil util_; | 98 InputMethodUtil util_; |
99 FakeImeKeyboard keyboard_; | 99 FakeImeKeyboard keyboard_; |
100 bool mod3_used_; | 100 bool mod3_used_; |
101 scoped_ptr<ComponentExtensionIMEManager> comp_ime_manager_; | 101 scoped_ptr<ComponentExtensionIMEManager> comp_ime_manager_; |
102 | 102 |
103 // The active input method ids cache (actually default only) | 103 // The active input method ids cache (actually default only) |
104 std::vector<std::string> active_input_method_ids_; | 104 std::vector<std::string> active_input_method_ids_; |
105 | 105 |
106 DISALLOW_COPY_AND_ASSIGN(MockInputMethodManager); | 106 DISALLOW_COPY_AND_ASSIGN(MockInputMethodManager); |
107 }; | 107 }; |
108 | 108 |
109 } // namespace input_method | 109 } // namespace input_method |
110 } // namespace chromeos | 110 } // namespace chromeos |
111 | 111 |
112 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_MANAGER_H_ | 112 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_MANAGER_H_ |
OLD | NEW |