| 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/ime/text_input_client.h" | 9 #include "ui/base/ime/text_input_client.h" |
| 10 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 } | 123 } |
| 124 | 124 |
| 125 bool MockInputMethod::IsActive() { | 125 bool MockInputMethod::IsActive() { |
| 126 return active_; | 126 return active_; |
| 127 } | 127 } |
| 128 | 128 |
| 129 bool MockInputMethod::IsCandidatePopupOpen() const { | 129 bool MockInputMethod::IsCandidatePopupOpen() const { |
| 130 return false; | 130 return false; |
| 131 } | 131 } |
| 132 | 132 |
| 133 void MockInputMethod::ShowImeIfNeeded() const { |
| 134 } |
| 135 |
| 133 bool MockInputMethod::IsMock() const { | 136 bool MockInputMethod::IsMock() const { |
| 134 return true; | 137 return true; |
| 135 } | 138 } |
| 136 | 139 |
| 137 void MockInputMethod::OnWillChangeFocus(View* focused_before, View* focused) { | 140 void MockInputMethod::OnWillChangeFocus(View* focused_before, View* focused) { |
| 138 ui::TextInputClient* client = GetTextInputClient(); | 141 ui::TextInputClient* client = GetTextInputClient(); |
| 139 if (client && client->HasCompositionText()) | 142 if (client && client->HasCompositionText()) |
| 140 client->ConfirmCompositionText(); | 143 client->ConfirmCompositionText(); |
| 141 focus_changed_ = true; | 144 focus_changed_ = true; |
| 142 ClearResult(); | 145 ClearResult(); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 input_locale_changed_ = false; | 183 input_locale_changed_ = false; |
| 181 } | 184 } |
| 182 | 185 |
| 183 void MockInputMethod::ClearResult() { | 186 void MockInputMethod::ClearResult() { |
| 184 composition_.Clear(); | 187 composition_.Clear(); |
| 185 composition_changed_ = false; | 188 composition_changed_ = false; |
| 186 result_text_.clear(); | 189 result_text_.clear(); |
| 187 } | 190 } |
| 188 | 191 |
| 189 } // namespace views | 192 } // namespace views |
| OLD | NEW |