Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(365)

Side by Side Diff: ui/base/ime/win/mock_tsf_bridge.cc

Issue 16648002: Enable TsfBridge to re-initialize (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/base/ime/win/mock_tsf_bridge.h ('k') | ui/base/ime/win/tsf_bridge.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "ui/base/ime/win/mock_tsf_bridge.h" 5 #include "ui/base/ime/win/mock_tsf_bridge.h"
6 6
7 #include "ui/base/ime/text_input_client.h" 7 #include "ui/base/ime/text_input_client.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 9
10 namespace ui { 10 namespace ui {
11 11
12 MockTSFBridge::MockTSFBridge() 12 MockTSFBridge::MockTSFBridge()
13 : shutdown_call_count_(0), 13 : enable_ime_call_count_(0),
14 enable_ime_call_count_(0),
15 disalbe_ime_call_count_(0), 14 disalbe_ime_call_count_(0),
16 cancel_composition_call_count_(0), 15 cancel_composition_call_count_(0),
17 on_text_layout_changed_(0), 16 on_text_layout_changed_(0),
18 associate_focus_call_count_(0), 17 associate_focus_call_count_(0),
19 set_focused_client_call_count_(0), 18 set_focused_client_call_count_(0),
20 remove_focused_client_call_count_(0), 19 remove_focused_client_call_count_(0),
21 text_input_client_(NULL), 20 text_input_client_(NULL),
22 focused_window_(NULL), 21 focused_window_(NULL),
23 latest_text_input_type_(TEXT_INPUT_TYPE_NONE) { 22 latest_text_input_type_(TEXT_INPUT_TYPE_NONE) {
24 } 23 }
25 24
26 MockTSFBridge::~MockTSFBridge() { 25 MockTSFBridge::~MockTSFBridge() {
27 } 26 }
28 27
29 void MockTSFBridge::Shutdown() {
30 shutdown_call_count_++;
31 }
32
33 bool MockTSFBridge::CancelComposition() { 28 bool MockTSFBridge::CancelComposition() {
34 ++cancel_composition_call_count_; 29 ++cancel_composition_call_count_;
35 return true; 30 return true;
36 } 31 }
37 32
38 void MockTSFBridge::OnTextInputTypeChanged(TextInputClient* client) { 33 void MockTSFBridge::OnTextInputTypeChanged(TextInputClient* client) {
39 latest_text_input_type_ = client->GetTextInputType(); 34 latest_text_input_type_ = client->GetTextInputType();
40 } 35 }
41 36
42 void MockTSFBridge::OnTextLayoutChanged() { 37 void MockTSFBridge::OnTextLayoutChanged() {
(...skipping 16 matching lines...) Expand all
59 54
60 base::win::ScopedComPtr<ITfThreadMgr> MockTSFBridge::GetThreadManager() { 55 base::win::ScopedComPtr<ITfThreadMgr> MockTSFBridge::GetThreadManager() {
61 return thread_manager_; 56 return thread_manager_;
62 } 57 }
63 58
64 TextInputClient* MockTSFBridge::GetFocusedTextInputClient() const { 59 TextInputClient* MockTSFBridge::GetFocusedTextInputClient() const {
65 return text_input_client_; 60 return text_input_client_;
66 } 61 }
67 62
68 void MockTSFBridge::Reset() { 63 void MockTSFBridge::Reset() {
69 shutdown_call_count_ = 0;
70 enable_ime_call_count_ = 0; 64 enable_ime_call_count_ = 0;
71 disalbe_ime_call_count_ = 0; 65 disalbe_ime_call_count_ = 0;
72 cancel_composition_call_count_ = 0; 66 cancel_composition_call_count_ = 0;
73 on_text_layout_changed_ = 0; 67 on_text_layout_changed_ = 0;
74 associate_focus_call_count_ = 0; 68 associate_focus_call_count_ = 0;
75 set_focused_client_call_count_ = 0; 69 set_focused_client_call_count_ = 0;
76 remove_focused_client_call_count_ = 0; 70 remove_focused_client_call_count_ = 0;
77 text_input_client_ = NULL; 71 text_input_client_ = NULL;
78 focused_window_ = NULL; 72 focused_window_ = NULL;
79 latest_text_input_type_ = TEXT_INPUT_TYPE_NONE; 73 latest_text_input_type_ = TEXT_INPUT_TYPE_NONE;
80 } 74 }
81 75
82 } // namespace ui 76 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/ime/win/mock_tsf_bridge.h ('k') | ui/base/ime/win/tsf_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698