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

Side by Side Diff: chromeos/ime/mock_ime_engine_handler.cc

Issue 45733008: sk6_charactercomposer: Merged DispatchKeyEvent and its fabricated version. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 1 month 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 | « chromeos/ime/mock_ime_engine_handler.h ('k') | ui/base/ime/dummy_input_method.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chromeos/ime/mock_ime_engine_handler.h" 5 #include "chromeos/ime/mock_ime_engine_handler.h"
6 6
7 namespace chromeos { 7 namespace chromeos {
8 8
9 MockIMEEngineHandler::MockIMEEngineHandler() 9 MockIMEEngineHandler::MockIMEEngineHandler()
10 : focus_in_call_count_(0), 10 : focus_in_call_count_(0),
11 focus_out_call_count_(0), 11 focus_out_call_count_(0),
12 set_surrounding_text_call_count_(0), 12 set_surrounding_text_call_count_(0),
13 process_key_event_call_count_(0), 13 process_key_event_call_count_(0),
14 reset_call_count_(0), 14 reset_call_count_(0),
15 last_text_input_type_(ibus::TEXT_INPUT_TYPE_NONE), 15 last_text_input_type_(ibus::TEXT_INPUT_TYPE_NONE),
16 last_set_surrounding_cursor_pos_(0), 16 last_set_surrounding_cursor_pos_(0),
17 last_set_surrounding_anchor_pos_(0), 17 last_set_surrounding_anchor_pos_(0),
18 last_processed_keysym_(0), 18 last_processed_is_key_down_(false),
19 last_processed_keycode_(0), 19 last_processed_is_alt_down_(false),
20 last_processed_state_(0) { 20 last_processed_is_ctrl_down_(false),
21 last_processed_is_shift_down_(false),
22 last_processed_is_caps_lock_down_(false) {
21 } 23 }
22 24
23 MockIMEEngineHandler::~MockIMEEngineHandler() { 25 MockIMEEngineHandler::~MockIMEEngineHandler() {
24 } 26 }
25 27
26 void MockIMEEngineHandler::FocusIn(ibus::TextInputType text_input_type) { 28 void MockIMEEngineHandler::FocusIn(ibus::TextInputType text_input_type) {
27 ++focus_in_call_count_; 29 ++focus_in_call_count_;
28 last_text_input_type_ = text_input_type; 30 last_text_input_type_ = text_input_type;
29 } 31 }
30 32
(...skipping 17 matching lines...) Expand all
48 } 50 }
49 51
50 void MockIMEEngineHandler::SetCapability(IBusCapability capability) { 52 void MockIMEEngineHandler::SetCapability(IBusCapability capability) {
51 } 53 }
52 54
53 void MockIMEEngineHandler::Reset() { 55 void MockIMEEngineHandler::Reset() {
54 ++reset_call_count_; 56 ++reset_call_count_;
55 } 57 }
56 58
57 void MockIMEEngineHandler::ProcessKeyEvent( 59 void MockIMEEngineHandler::ProcessKeyEvent(
58 uint32 keysym, 60 const std::string& keysym,
59 uint32 keycode, 61 const std::string& keycode,
60 uint32 state, 62 bool is_key_down,
63 bool is_alt_down,
64 bool is_ctrl_down,
65 bool is_shift_down,
66 bool is_caps_lock_down,
61 const KeyEventDoneCallback& callback) { 67 const KeyEventDoneCallback& callback) {
62 ++process_key_event_call_count_; 68 ++process_key_event_call_count_;
63 last_processed_keysym_ = keysym; 69 last_processed_keysym_ = keysym;
64 last_processed_keycode_ = keycode; 70 last_processed_keycode_ = keycode;
65 last_processed_state_ = state; 71 last_processed_is_key_down_ = is_key_down;
72 last_processed_is_alt_down_ = is_alt_down;
73 last_processed_is_ctrl_down_ = is_ctrl_down;
74 last_processed_is_shift_down_ = is_shift_down;
75 last_processed_is_caps_lock_down_ = is_caps_lock_down;
66 last_passed_callback_ = callback; 76 last_passed_callback_ = callback;
67 } 77 }
68 78
69 void MockIMEEngineHandler::CandidateClicked(uint32 index, 79 void MockIMEEngineHandler::CandidateClicked(uint32 index,
70 ibus::IBusMouseButton button, 80 ibus::IBusMouseButton button,
71 uint32 state) { 81 uint32 state) {
72 } 82 }
73 83
74 void MockIMEEngineHandler::SetSurroundingText(const std::string& text, 84 void MockIMEEngineHandler::SetSurroundingText(const std::string& text,
75 uint32 cursor_pos, 85 uint32 cursor_pos,
76 uint32 anchor_pos) { 86 uint32 anchor_pos) {
77 ++set_surrounding_text_call_count_; 87 ++set_surrounding_text_call_count_;
78 last_set_surrounding_text_ = text; 88 last_set_surrounding_text_ = text;
79 last_set_surrounding_cursor_pos_ = cursor_pos; 89 last_set_surrounding_cursor_pos_ = cursor_pos;
80 last_set_surrounding_anchor_pos_ = anchor_pos; 90 last_set_surrounding_anchor_pos_ = anchor_pos;
81 } 91 }
82 92
83 } // namespace chromeos 93 } // namespace chromeos
84
OLDNEW
« no previous file with comments | « chromeos/ime/mock_ime_engine_handler.h ('k') | ui/base/ime/dummy_input_method.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698