| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/views/ime/mock_input_method.h" | 5 #include "ui/views/ime/mock_input_method.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "ui/base/events/event.h" | 9 #include "ui/base/events/event.h" |
| 10 #include "ui/base/ime/text_input_client.h" | 10 #include "ui/base/ime/text_input_client.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 } | 125 } |
| 126 | 126 |
| 127 base::i18n::TextDirection MockInputMethod::GetInputTextDirection() { | 127 base::i18n::TextDirection MockInputMethod::GetInputTextDirection() { |
| 128 return direction_; | 128 return direction_; |
| 129 } | 129 } |
| 130 | 130 |
| 131 bool MockInputMethod::IsActive() { | 131 bool MockInputMethod::IsActive() { |
| 132 return active_; | 132 return active_; |
| 133 } | 133 } |
| 134 | 134 |
| 135 bool MockInputMethod::IsCandidatePopupOpen() const { |
| 136 return false; |
| 137 } |
| 138 |
| 135 bool MockInputMethod::IsMock() const { | 139 bool MockInputMethod::IsMock() const { |
| 136 return true; | 140 return true; |
| 137 } | 141 } |
| 138 | 142 |
| 139 void MockInputMethod::OnWillChangeFocus(View* focused_before, View* focused) { | 143 void MockInputMethod::OnWillChangeFocus(View* focused_before, View* focused) { |
| 140 ui::TextInputClient* client = GetTextInputClient(); | 144 ui::TextInputClient* client = GetTextInputClient(); |
| 141 if (client && client->HasCompositionText()) | 145 if (client && client->HasCompositionText()) |
| 142 client->ConfirmCompositionText(); | 146 client->ConfirmCompositionText(); |
| 143 focus_changed_ = true; | 147 focus_changed_ = true; |
| 144 ClearResult(); | 148 ClearResult(); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 input_locale_changed_ = false; | 194 input_locale_changed_ = false; |
| 191 } | 195 } |
| 192 | 196 |
| 193 void MockInputMethod::ClearResult() { | 197 void MockInputMethod::ClearResult() { |
| 194 composition_.Clear(); | 198 composition_.Clear(); |
| 195 composition_changed_ = false; | 199 composition_changed_ = false; |
| 196 result_text_.clear(); | 200 result_text_.clear(); |
| 197 } | 201 } |
| 198 | 202 |
| 199 } // namespace views | 203 } // namespace views |
| OLD | NEW |