| OLD | NEW |
| 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), | 12 : text_input_type_(TEXT_INPUT_TYPE_NONE), insert_char_count_(0) {} |
| 13 insert_char_count_(0), | |
| 14 insert_text_count_(0) {} | |
| 15 | 13 |
| 16 DummyTextInputClient::DummyTextInputClient(TextInputType text_input_type) | 14 DummyTextInputClient::DummyTextInputClient(TextInputType text_input_type) |
| 17 : text_input_type_(text_input_type), | 15 : text_input_type_(text_input_type), insert_char_count_(0) {} |
| 18 insert_char_count_(0), | |
| 19 insert_text_count_(0) {} | |
| 20 | 16 |
| 21 DummyTextInputClient::~DummyTextInputClient() { | 17 DummyTextInputClient::~DummyTextInputClient() { |
| 22 } | 18 } |
| 23 | 19 |
| 24 void DummyTextInputClient::SetCompositionText( | 20 void DummyTextInputClient::SetCompositionText( |
| 25 const CompositionText& composition) { | 21 const CompositionText& composition) { |
| 26 } | 22 } |
| 27 | 23 |
| 28 void DummyTextInputClient::ConfirmCompositionText() { | 24 void DummyTextInputClient::ConfirmCompositionText() { |
| 29 } | 25 } |
| 30 | 26 |
| 31 void DummyTextInputClient::ClearCompositionText() { | 27 void DummyTextInputClient::ClearCompositionText() { |
| 32 } | 28 } |
| 33 | 29 |
| 34 void DummyTextInputClient::InsertText(const base::string16& text) { | 30 void DummyTextInputClient::InsertText(const base::string16& text) { |
| 35 ++insert_text_count_; | |
| 36 last_insert_text_ = text; | |
| 37 } | 31 } |
| 38 | 32 |
| 39 void DummyTextInputClient::InsertChar(const KeyEvent& event) { | 33 void DummyTextInputClient::InsertChar(const KeyEvent& event) { |
| 40 ++insert_char_count_; | 34 ++insert_char_count_; |
| 41 last_insert_char_ = event.GetCharacter(); | 35 last_insert_char_ = event.GetCharacter(); |
| 42 } | 36 } |
| 43 | 37 |
| 44 TextInputType DummyTextInputClient::GetTextInputType() const { | 38 TextInputType DummyTextInputClient::GetTextInputType() const { |
| 45 return text_input_type_; | 39 return text_input_type_; |
| 46 } | 40 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 } | 106 } |
| 113 | 107 |
| 114 bool DummyTextInputClient::IsEditCommandEnabled(int command_id) { | 108 bool DummyTextInputClient::IsEditCommandEnabled(int command_id) { |
| 115 return false; | 109 return false; |
| 116 } | 110 } |
| 117 | 111 |
| 118 void DummyTextInputClient::SetEditCommandForNextKeyEvent(int command_id) { | 112 void DummyTextInputClient::SetEditCommandForNextKeyEvent(int command_id) { |
| 119 } | 113 } |
| 120 | 114 |
| 121 } // namespace ui | 115 } // namespace ui |
| OLD | NEW |