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 InitializeComponentExtension() OVERRIDE; | 34 virtual void InitializeComponentExtension() OVERRIDE; |
26 virtual void AddObserver(InputMethodManager::Observer* observer) OVERRIDE; | 35 virtual void AddObserver(InputMethodManager::Observer* observer) OVERRIDE; |
27 virtual void AddCandidateWindowObserver( | 36 virtual void AddCandidateWindowObserver( |
28 InputMethodManager::CandidateWindowObserver* observer) OVERRIDE; | 37 InputMethodManager::CandidateWindowObserver* observer) OVERRIDE; |
29 virtual void RemoveObserver(InputMethodManager::Observer* observer) OVERRIDE; | 38 virtual void RemoveObserver(InputMethodManager::Observer* observer) OVERRIDE; |
30 virtual void RemoveCandidateWindowObserver( | 39 virtual void RemoveCandidateWindowObserver( |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 virtual bool IsISOLevel5ShiftUsedByCurrentInputMethod() const OVERRIDE; | 76 virtual bool IsISOLevel5ShiftUsedByCurrentInputMethod() const OVERRIDE; |
68 virtual bool IsAltGrUsedByCurrentInputMethod() const OVERRIDE; | 77 virtual bool IsAltGrUsedByCurrentInputMethod() const OVERRIDE; |
69 virtual ImeKeyboard* GetImeKeyboard() OVERRIDE; | 78 virtual ImeKeyboard* GetImeKeyboard() OVERRIDE; |
70 virtual InputMethodUtil* GetInputMethodUtil() OVERRIDE; | 79 virtual InputMethodUtil* GetInputMethodUtil() OVERRIDE; |
71 virtual ComponentExtensionIMEManager* | 80 virtual ComponentExtensionIMEManager* |
72 GetComponentExtensionIMEManager() OVERRIDE; | 81 GetComponentExtensionIMEManager() OVERRIDE; |
73 virtual bool IsLoginKeyboard(const std::string& layout) const OVERRIDE; | 82 virtual bool IsLoginKeyboard(const std::string& layout) const OVERRIDE; |
74 virtual bool MigrateInputMethods( | 83 virtual bool MigrateInputMethods( |
75 std::vector<std::string>* input_method_ids) OVERRIDE; | 84 std::vector<std::string>* input_method_ids) OVERRIDE; |
76 | 85 |
| 86 virtual scoped_refptr<InputMethodManager::State> CreateNewState( |
| 87 const std::string& debug_name) const OVERRIDE; |
| 88 virtual void SetState( |
| 89 scoped_refptr<InputMethodManager::State> state) OVERRIDE; |
| 90 |
77 // Sets an input method ID which will be returned by GetCurrentInputMethod(). | 91 // Sets an input method ID which will be returned by GetCurrentInputMethod(). |
78 void SetCurrentInputMethodId(const std::string& input_method_id) { | 92 void SetCurrentInputMethodId(const std::string& input_method_id) { |
79 current_input_method_id_ = input_method_id; | 93 current_input_method_id_ = input_method_id; |
80 } | 94 } |
81 | 95 |
82 void SetComponentExtensionIMEManager( | 96 void SetComponentExtensionIMEManager( |
83 scoped_ptr<ComponentExtensionIMEManager> comp_ime_manager); | 97 scoped_ptr<ComponentExtensionIMEManager> comp_ime_manager); |
84 | 98 |
85 // Set values that will be provided to the InputMethodUtil. | 99 // Set values that will be provided to the InputMethodUtil. |
86 void set_application_locale(const std::string& value); | 100 void set_application_locale(const std::string& value); |
(...skipping 18 matching lines...) Expand all Loading... |
105 // The active input method ids cache (actually default only) | 119 // The active input method ids cache (actually default only) |
106 std::vector<std::string> active_input_method_ids_; | 120 std::vector<std::string> active_input_method_ids_; |
107 | 121 |
108 DISALLOW_COPY_AND_ASSIGN(MockInputMethodManager); | 122 DISALLOW_COPY_AND_ASSIGN(MockInputMethodManager); |
109 }; | 123 }; |
110 | 124 |
111 } // namespace input_method | 125 } // namespace input_method |
112 } // namespace chromeos | 126 } // namespace chromeos |
113 | 127 |
114 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_MANAGER_H_ | 128 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_MANAGER_H_ |
OLD | NEW |