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

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

Issue 16901011: Support CancelCompositionText/ComfirmCompositionText in TSF (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 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
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 : enable_ime_call_count_(0), 13 : enable_ime_call_count_(0),
14 disalbe_ime_call_count_(0), 14 disalbe_ime_call_count_(0),
15 cancel_composition_call_count_(0), 15 cancel_composition_call_count_(0),
16 confirm_composition_call_count_(0),
16 on_text_layout_changed_(0), 17 on_text_layout_changed_(0),
17 associate_focus_call_count_(0), 18 associate_focus_call_count_(0),
18 set_focused_client_call_count_(0), 19 set_focused_client_call_count_(0),
19 remove_focused_client_call_count_(0), 20 remove_focused_client_call_count_(0),
20 text_input_client_(NULL), 21 text_input_client_(NULL),
21 focused_window_(NULL), 22 focused_window_(NULL),
22 latest_text_input_type_(TEXT_INPUT_TYPE_NONE) { 23 latest_text_input_type_(TEXT_INPUT_TYPE_NONE) {
23 } 24 }
24 25
25 MockTSFBridge::~MockTSFBridge() { 26 MockTSFBridge::~MockTSFBridge() {
26 } 27 }
27 28
28 bool MockTSFBridge::CancelComposition() { 29 bool MockTSFBridge::CancelComposition() {
29 ++cancel_composition_call_count_; 30 ++cancel_composition_call_count_;
30 return true; 31 return true;
31 } 32 }
32 33
34 bool MockTSFBridge::ConfirmComposition() {
35 ++confirm_composition_call_count_;
36 return true;
37 }
38
33 void MockTSFBridge::OnTextInputTypeChanged(const TextInputClient* client) { 39 void MockTSFBridge::OnTextInputTypeChanged(const TextInputClient* client) {
34 latest_text_input_type_ = client->GetTextInputType(); 40 latest_text_input_type_ = client->GetTextInputType();
35 } 41 }
36 42
37 void MockTSFBridge::OnTextLayoutChanged() { 43 void MockTSFBridge::OnTextLayoutChanged() {
38 ++on_text_layout_changed_; 44 ++on_text_layout_changed_;
39 } 45 }
40 46
41 void MockTSFBridge::SetFocusedClient(HWND focused_window, 47 void MockTSFBridge::SetFocusedClient(HWND focused_window,
42 TextInputClient* client) { 48 TextInputClient* client) {
(...skipping 14 matching lines...) Expand all
57 } 63 }
58 64
59 TextInputClient* MockTSFBridge::GetFocusedTextInputClient() const { 65 TextInputClient* MockTSFBridge::GetFocusedTextInputClient() const {
60 return text_input_client_; 66 return text_input_client_;
61 } 67 }
62 68
63 void MockTSFBridge::Reset() { 69 void MockTSFBridge::Reset() {
64 enable_ime_call_count_ = 0; 70 enable_ime_call_count_ = 0;
65 disalbe_ime_call_count_ = 0; 71 disalbe_ime_call_count_ = 0;
66 cancel_composition_call_count_ = 0; 72 cancel_composition_call_count_ = 0;
73 confirm_composition_call_count_ = 0;
67 on_text_layout_changed_ = 0; 74 on_text_layout_changed_ = 0;
68 associate_focus_call_count_ = 0; 75 associate_focus_call_count_ = 0;
69 set_focused_client_call_count_ = 0; 76 set_focused_client_call_count_ = 0;
70 remove_focused_client_call_count_ = 0; 77 remove_focused_client_call_count_ = 0;
71 text_input_client_ = NULL; 78 text_input_client_ = NULL;
72 focused_window_ = NULL; 79 focused_window_ = NULL;
73 latest_text_input_type_ = TEXT_INPUT_TYPE_NONE; 80 latest_text_input_type_ = TEXT_INPUT_TYPE_NONE;
74 } 81 }
75 82
76 } // namespace ui 83 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698