| 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_WIN_MOCK_TSF_BRIDGE_H_ | 5 #ifndef UI_BASE_WIN_MOCK_TSF_BRIDGE_H_ |
| 6 #define UI_BASE_WIN_MOCK_TSF_BRIDGE_H_ | 6 #define UI_BASE_WIN_MOCK_TSF_BRIDGE_H_ |
| 7 | 7 |
| 8 #include <msctf.h> |
| 9 |
| 8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/win/scoped_comptr.h" |
| 9 #include "ui/base/ime/text_input_type.h" | 12 #include "ui/base/ime/text_input_type.h" |
| 10 #include "ui/base/win/tsf_bridge.h" | 13 #include "ui/base/win/tsf_bridge.h" |
| 11 | 14 |
| 12 namespace ui { | 15 namespace ui { |
| 13 | 16 |
| 14 class MockTsfBridge : public TsfBridge { | 17 class MockTsfBridge : public TsfBridge { |
| 15 public: | 18 public: |
| 16 MockTsfBridge(); | 19 MockTsfBridge(); |
| 17 virtual ~MockTsfBridge(); | 20 virtual ~MockTsfBridge(); |
| 18 | 21 |
| 19 // TsfBridge override. | 22 // TsfBridge override. |
| 20 virtual void Shutdown() OVERRIDE; | 23 virtual void Shutdown() OVERRIDE; |
| 21 | 24 |
| 22 // TsfBridge override. | 25 // TsfBridge override. |
| 23 virtual bool CancelComposition() OVERRIDE; | 26 virtual bool CancelComposition() OVERRIDE; |
| 24 | 27 |
| 25 // TsfBridge override. | 28 // TsfBridge override. |
| 26 virtual void OnTextInputTypeChanged(TextInputClient* client) OVERRIDE; | 29 virtual void OnTextInputTypeChanged(TextInputClient* client) OVERRIDE; |
| 27 | 30 |
| 28 // TsfBridge override. | 31 // TsfBridge override. |
| 29 virtual void SetFocusedClient(HWND focused_window, | 32 virtual void SetFocusedClient(HWND focused_window, |
| 30 TextInputClient* client) OVERRIDE; | 33 TextInputClient* client) OVERRIDE; |
| 31 | 34 |
| 32 // TsfBridge override. | 35 // TsfBridge override. |
| 33 virtual void RemoveFocusedClient(TextInputClient* client) OVERRIDE; | 36 virtual void RemoveFocusedClient(TextInputClient* client) OVERRIDE; |
| 34 | 37 |
| 38 // TsfBridge override. |
| 39 virtual base::win::ScopedComPtr<ITfThreadMgr> GetThreadManager() OVERRIDE; |
| 40 |
| 35 // Resets MockTsfBridge state including function call counter. | 41 // Resets MockTsfBridge state including function call counter. |
| 36 void Reset(); | 42 void Reset(); |
| 37 | 43 |
| 38 // Call count of Shutdown(). | 44 // Call count of Shutdown(). |
| 39 int shutdown_call_count() const { return shutdown_call_count_; } | 45 int shutdown_call_count() const { return shutdown_call_count_; } |
| 40 | 46 |
| 41 // Call count of EnableIME(). | 47 // Call count of EnableIME(). |
| 42 int enable_ime_call_count() const { return enable_ime_call_count_; } | 48 int enable_ime_call_count() const { return enable_ime_call_count_; } |
| 43 | 49 |
| 44 // Call count of DisableIME(). | 50 // Call count of DisableIME(). |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 int shutdown_call_count_; | 83 int shutdown_call_count_; |
| 78 int enable_ime_call_count_; | 84 int enable_ime_call_count_; |
| 79 int disalbe_ime_call_count_; | 85 int disalbe_ime_call_count_; |
| 80 int cancel_composition_call_count_; | 86 int cancel_composition_call_count_; |
| 81 int associate_focus_call_count_; | 87 int associate_focus_call_count_; |
| 82 int set_focused_client_call_count_; | 88 int set_focused_client_call_count_; |
| 83 int remove_focused_client_call_count_; | 89 int remove_focused_client_call_count_; |
| 84 TextInputClient* text_input_client_; | 90 TextInputClient* text_input_client_; |
| 85 HWND focused_window_; | 91 HWND focused_window_; |
| 86 TextInputType latest_text_input_type_; | 92 TextInputType latest_text_input_type_; |
| 93 base::win::ScopedComPtr<ITfThreadMgr> thread_manager_; |
| 87 | 94 |
| 88 DISALLOW_COPY_AND_ASSIGN(MockTsfBridge); | 95 DISALLOW_COPY_AND_ASSIGN(MockTsfBridge); |
| 89 }; | 96 }; |
| 90 | 97 |
| 91 } // namespace ui | 98 } // namespace ui |
| 92 | 99 |
| 93 #endif // UI_BASE_WIN_MOCK_TSF_BRIDGE_H_ | 100 #endif // UI_BASE_WIN_MOCK_TSF_BRIDGE_H_ |
| OLD | NEW |