| 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 UI_BASE_IME_MOCK_INPUT_METHOD_H_ | 5 #ifndef UI_BASE_IME_MOCK_INPUT_METHOD_H_ |
| 6 #define UI_BASE_IME_MOCK_INPUT_METHOD_H_ | 6 #define UI_BASE_IME_MOCK_INPUT_METHOD_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
| 13 #include "ui/base/ime/input_method.h" | 13 #include "ui/base/ime/input_method.h" |
| 14 #include "ui/base/ime/input_method_observer.h" | 14 #include "ui/base/ime/input_method_observer.h" |
| 15 #include "ui/base/ui_export.h" | 15 #include "ui/base/ui_export.h" |
| 16 | 16 |
| 17 namespace ui { | 17 namespace ui { |
| 18 | 18 |
| 19 class KeyEvent; | 19 class KeyEvent; |
| 20 class TextInputClient; | 20 class TextInputClient; |
| 21 | 21 |
| 22 // A mock ui::InputMethod implementation for testing. You can get the instance | 22 // A mock ui::InputMethod implementation for testing. You can get the instance |
| 23 // of this class as the global input method with calling | 23 // of this class as the global input method with calling |
| 24 // SetUpInputMethodFacotryForTesting() which is declared in | 24 // SetUpInputMethodFactoryForTesting() which is declared in |
| 25 // ui/base/ime/input_method_factory.h | 25 // ui/base/ime/input_method_factory.h |
| 26 class UI_EXPORT MockInputMethod : NON_EXPORTED_BASE(public InputMethod) { | 26 class UI_EXPORT MockInputMethod : NON_EXPORTED_BASE(public InputMethod) { |
| 27 public: | 27 public: |
| 28 class Observer : public InputMethodObserver { | 28 class Observer : public InputMethodObserver { |
| 29 public: | 29 public: |
| 30 virtual void OnTextInputTypeChanged(const TextInputClient* client) = 0; | 30 virtual void OnTextInputTypeChanged(const TextInputClient* client) = 0; |
| 31 virtual void OnFocus() = 0; | 31 virtual void OnFocus() = 0; |
| 32 virtual void OnBlur() = 0; | 32 virtual void OnBlur() = 0; |
| 33 virtual void OnCaretBoundsChanged(const TextInputClient* client) = 0; | 33 virtual void OnCaretBoundsChanged(const TextInputClient* client) = 0; |
| 34 | 34 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 61 private: | 61 private: |
| 62 TextInputClient* text_input_client_; | 62 TextInputClient* text_input_client_; |
| 63 ObserverList<Observer> observer_list_; | 63 ObserverList<Observer> observer_list_; |
| 64 | 64 |
| 65 DISALLOW_COPY_AND_ASSIGN(MockInputMethod); | 65 DISALLOW_COPY_AND_ASSIGN(MockInputMethod); |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 } // namespace ui | 68 } // namespace ui |
| 69 | 69 |
| 70 #endif // UI_BASE_IME_MOCK_INPUT_METHOD_H_ | 70 #endif // UI_BASE_IME_MOCK_INPUT_METHOD_H_ |
| OLD | NEW |