| 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/fake_input_method_delegate.h" | 9 #include "chromeos/ime/fake_input_method_delegate.h" |
| 10 #include "chromeos/ime/input_method_manager.h" | 10 #include "chromeos/ime/input_method_manager.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 InputMethodManager::CandidateWindowObserver* observer) OVERRIDE; | 29 InputMethodManager::CandidateWindowObserver* observer) OVERRIDE; |
| 30 virtual scoped_ptr<InputMethodDescriptors> | 30 virtual scoped_ptr<InputMethodDescriptors> |
| 31 GetSupportedInputMethods() const OVERRIDE; | 31 GetSupportedInputMethods() const OVERRIDE; |
| 32 virtual scoped_ptr<InputMethodDescriptors> | 32 virtual scoped_ptr<InputMethodDescriptors> |
| 33 GetActiveInputMethods() const OVERRIDE; | 33 GetActiveInputMethods() const OVERRIDE; |
| 34 virtual const std::vector<std::string>& GetActiveInputMethodIds() const | 34 virtual const std::vector<std::string>& GetActiveInputMethodIds() const |
| 35 OVERRIDE; | 35 OVERRIDE; |
| 36 virtual size_t GetNumActiveInputMethods() const OVERRIDE; | 36 virtual size_t GetNumActiveInputMethods() const OVERRIDE; |
| 37 virtual const InputMethodDescriptor* GetInputMethodFromId( | 37 virtual const InputMethodDescriptor* GetInputMethodFromId( |
| 38 const std::string& input_method_id) const OVERRIDE; | 38 const std::string& input_method_id) const OVERRIDE; |
| 39 virtual void EnableLoginLayouts(const std::string& language_code, | 39 virtual void EnableLoginLayouts( |
| 40 const std::string& initial_layout) OVERRIDE; | 40 const std::string& language_code, |
| 41 const std::vector<std::string>& initial_layout) OVERRIDE; |
| 41 virtual bool EnableInputMethods( | 42 virtual bool EnableInputMethods( |
| 42 const std::vector<std::string>& new_active_input_method_ids) OVERRIDE; | 43 const std::vector<std::string>& new_active_input_method_ids) OVERRIDE; |
| 43 virtual bool EnableInputMethod( | 44 virtual bool EnableInputMethod( |
| 44 const std::string& new_active_input_method_id) OVERRIDE; | 45 const std::string& new_active_input_method_id) OVERRIDE; |
| 45 virtual void ChangeInputMethod(const std::string& input_method_id) OVERRIDE; | 46 virtual void ChangeInputMethod(const std::string& input_method_id) OVERRIDE; |
| 46 virtual void ActivateInputMethodProperty(const std::string& key) OVERRIDE; | 47 virtual void ActivateInputMethodProperty(const std::string& key) OVERRIDE; |
| 47 virtual void AddInputMethodExtension( | 48 virtual void AddInputMethodExtension( |
| 48 const std::string& id, | 49 const std::string& id, |
| 49 InputMethodEngineInterface* instance) OVERRIDE; | 50 InputMethodEngineInterface* instance) OVERRIDE; |
| 50 virtual void RemoveInputMethodExtension(const std::string& id) OVERRIDE; | 51 virtual void RemoveInputMethodExtension(const std::string& id) OVERRIDE; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 67 GetComponentExtensionIMEManager() OVERRIDE; | 68 GetComponentExtensionIMEManager() OVERRIDE; |
| 68 virtual bool IsLoginKeyboard(const std::string& layout) const OVERRIDE; | 69 virtual bool IsLoginKeyboard(const std::string& layout) const OVERRIDE; |
| 69 | 70 |
| 70 // Sets an input method ID which will be returned by GetCurrentInputMethod(). | 71 // Sets an input method ID which will be returned by GetCurrentInputMethod(). |
| 71 void SetCurrentInputMethodId(const std::string& input_method_id) { | 72 void SetCurrentInputMethodId(const std::string& input_method_id) { |
| 72 current_input_method_id_ = input_method_id; | 73 current_input_method_id_ = input_method_id; |
| 73 } | 74 } |
| 74 | 75 |
| 75 // Set values that will be provided to the InputMethodUtil. | 76 // Set values that will be provided to the InputMethodUtil. |
| 76 void set_application_locale(const std::string& value); | 77 void set_application_locale(const std::string& value); |
| 77 void set_hardware_keyboard_layout(const std::string& value); | 78 void set_hardware_keyboard_layout(const std::vector<std::string>& value); |
| 78 | 79 |
| 79 // TODO(yusukes): Add more variables for counting the numbers of the API calls | 80 // TODO(yusukes): Add more variables for counting the numbers of the API calls |
| 80 int add_observer_count_; | 81 int add_observer_count_; |
| 81 int remove_observer_count_; | 82 int remove_observer_count_; |
| 82 | 83 |
| 83 private: | 84 private: |
| 84 // The value GetCurrentInputMethod().id() will return. | 85 // The value GetCurrentInputMethod().id() will return. |
| 85 std::string current_input_method_id_; | 86 std::string current_input_method_id_; |
| 86 | 87 |
| 87 InputMethodWhitelist whitelist_; | 88 InputMethodWhitelist whitelist_; |
| 88 FakeInputMethodDelegate delegate_; // used by util_ | 89 FakeInputMethodDelegate delegate_; // used by util_ |
| 89 InputMethodUtil util_; | 90 InputMethodUtil util_; |
| 90 MockXKeyboard xkeyboard_; | 91 MockXKeyboard xkeyboard_; |
| 91 | 92 |
| 92 // The active input method ids cache (actually default only) | 93 // The active input method ids cache (actually default only) |
| 93 std::vector<std::string> active_input_method_ids_; | 94 std::vector<std::string> active_input_method_ids_; |
| 94 | 95 |
| 95 DISALLOW_COPY_AND_ASSIGN(MockInputMethodManager); | 96 DISALLOW_COPY_AND_ASSIGN(MockInputMethodManager); |
| 96 }; | 97 }; |
| 97 | 98 |
| 98 } // namespace input_method | 99 } // namespace input_method |
| 99 } // namespace chromeos | 100 } // namespace chromeos |
| 100 | 101 |
| 101 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_MANAGER_H_ | 102 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_MANAGER_H_ |
| OLD | NEW |