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_WIN_MOCK_TSF_BRIDGE_H_ | 5 #ifndef UI_BASE_IME_WIN_MOCK_TSF_BRIDGE_H_ |
6 #define UI_BASE_IME_WIN_MOCK_TSF_BRIDGE_H_ | 6 #define UI_BASE_IME_WIN_MOCK_TSF_BRIDGE_H_ |
7 | 7 |
8 #include <msctf.h> | 8 #include <msctf.h> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/win/scoped_comptr.h" | 11 #include "base/win/scoped_comptr.h" |
12 #include "ui/base/ime/text_input_type.h" | 12 #include "ui/base/ime/text_input_type.h" |
13 #include "ui/base/ime/win/tsf_bridge.h" | 13 #include "ui/base/ime/win/tsf_bridge.h" |
14 | 14 |
15 namespace ui { | 15 namespace ui { |
16 | 16 |
17 class MockTSFBridge : public TSFBridge { | 17 class MockTSFBridge : public TSFBridge { |
18 public: | 18 public: |
19 MockTSFBridge(); | 19 MockTSFBridge(); |
20 virtual ~MockTSFBridge(); | 20 virtual ~MockTSFBridge(); |
21 | 21 |
22 // TSFBridge: | 22 // TSFBridge: |
23 virtual void Shutdown() OVERRIDE; | 23 virtual void Shutdown() OVERRIDE; |
24 virtual bool CancelComposition() OVERRIDE; | 24 virtual bool CancelComposition() OVERRIDE; |
25 virtual void OnTextInputTypeChanged(TextInputClient* client) OVERRIDE; | 25 virtual void OnTextInputTypeChanged(TextInputClient* client) OVERRIDE; |
26 virtual void SetFocusedClient(HWND focused_window, | 26 virtual void SetFocusedClient(HWND focused_window, |
27 TextInputClient* client) OVERRIDE; | 27 TextInputClient* client) OVERRIDE; |
28 virtual void RemoveFocusedClient(TextInputClient* client) OVERRIDE; | 28 virtual void RemoveFocusedClient(TextInputClient* client) OVERRIDE; |
29 virtual base::win::ScopedComPtr<ITfThreadMgr> GetThreadManager() OVERRIDE; | 29 virtual base::win::ScopedComPtr<ITfThreadMgr> GetThreadManager() OVERRIDE; |
| 30 virtual TextInputClient* GetFocusedTextInputClient() const OVERRIDE; |
30 | 31 |
31 // Resets MockTSFBridge state including function call counter. | 32 // Resets MockTSFBridge state including function call counter. |
32 void Reset(); | 33 void Reset(); |
33 | 34 |
34 // Call count of Shutdown(). | 35 // Call count of Shutdown(). |
35 int shutdown_call_count() const { return shutdown_call_count_; } | 36 int shutdown_call_count() const { return shutdown_call_count_; } |
36 | 37 |
37 // Call count of EnableIME(). | 38 // Call count of EnableIME(). |
38 int enable_ime_call_count() const { return enable_ime_call_count_; } | 39 int enable_ime_call_count() const { return enable_ime_call_count_; } |
39 | 40 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 HWND focused_window_; | 82 HWND focused_window_; |
82 TextInputType latest_text_input_type_; | 83 TextInputType latest_text_input_type_; |
83 base::win::ScopedComPtr<ITfThreadMgr> thread_manager_; | 84 base::win::ScopedComPtr<ITfThreadMgr> thread_manager_; |
84 | 85 |
85 DISALLOW_COPY_AND_ASSIGN(MockTSFBridge); | 86 DISALLOW_COPY_AND_ASSIGN(MockTSFBridge); |
86 }; | 87 }; |
87 | 88 |
88 } // namespace ui | 89 } // namespace ui |
89 | 90 |
90 #endif // UI_BASE_IME_WIN_MOCK_TSF_BRIDGE_H_ | 91 #endif // UI_BASE_IME_WIN_MOCK_TSF_BRIDGE_H_ |
OLD | NEW |