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

Side by Side Diff: ui/base/ime/dummy_text_input_client.cc

Issue 1780523006: Add tests for input.ime.* APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 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 "ui/base/ime/dummy_text_input_client.h" 5 #include "ui/base/ime/dummy_text_input_client.h"
6 #include "ui/events/event.h" 6 #include "ui/events/event.h"
7 #include "ui/gfx/geometry/rect.h" 7 #include "ui/gfx/geometry/rect.h"
8 8
9 namespace ui { 9 namespace ui {
10 10
11 DummyTextInputClient::DummyTextInputClient() 11 DummyTextInputClient::DummyTextInputClient()
12 : text_input_type_(TEXT_INPUT_TYPE_NONE), insert_char_count_(0) {} 12 : text_input_type_(TEXT_INPUT_TYPE_NONE),
13 insert_char_count_(0),
14 insert_text_count_(0) {}
13 15
14 DummyTextInputClient::DummyTextInputClient(TextInputType text_input_type) 16 DummyTextInputClient::DummyTextInputClient(TextInputType text_input_type)
15 : text_input_type_(text_input_type), insert_char_count_(0) {} 17 : text_input_type_(text_input_type),
18 insert_char_count_(0),
19 insert_text_count_(0) {}
16 20
17 DummyTextInputClient::~DummyTextInputClient() { 21 DummyTextInputClient::~DummyTextInputClient() {
18 } 22 }
19 23
20 void DummyTextInputClient::SetCompositionText( 24 void DummyTextInputClient::SetCompositionText(
21 const CompositionText& composition) { 25 const CompositionText& composition) {
22 } 26 }
23 27
24 void DummyTextInputClient::ConfirmCompositionText() { 28 void DummyTextInputClient::ConfirmCompositionText() {
25 } 29 }
26 30
27 void DummyTextInputClient::ClearCompositionText() { 31 void DummyTextInputClient::ClearCompositionText() {
28 } 32 }
29 33
30 void DummyTextInputClient::InsertText(const base::string16& text) { 34 void DummyTextInputClient::InsertText(const base::string16& text) {
35 ++insert_text_count_;
36 last_insert_text_ = text;
31 } 37 }
32 38
33 void DummyTextInputClient::InsertChar(const KeyEvent& event) { 39 void DummyTextInputClient::InsertChar(const KeyEvent& event) {
34 ++insert_char_count_; 40 ++insert_char_count_;
35 last_insert_char_ = event.GetCharacter(); 41 last_insert_char_ = event.GetCharacter();
36 } 42 }
37 43
38 TextInputType DummyTextInputClient::GetTextInputType() const { 44 TextInputType DummyTextInputClient::GetTextInputType() const {
39 return text_input_type_; 45 return text_input_type_;
40 } 46 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 } 112 }
107 113
108 bool DummyTextInputClient::IsEditCommandEnabled(int command_id) { 114 bool DummyTextInputClient::IsEditCommandEnabled(int command_id) {
109 return false; 115 return false;
110 } 116 }
111 117
112 void DummyTextInputClient::SetEditCommandForNextKeyEvent(int command_id) { 118 void DummyTextInputClient::SetEditCommandForNextKeyEvent(int command_id) {
113 } 119 }
114 120
115 } // namespace ui 121 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698