OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/test_runner/text_input_controller.h" | 5 #include "components/test_runner/text_input_controller.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "components/test_runner/web_test_delegate.h" | 8 #include "components/test_runner/web_test_delegate.h" |
9 #include "components/test_runner/web_view_test_proxy.h" | 9 #include "components/test_runner/web_view_test_proxy.h" |
10 #include "gin/arguments.h" | 10 #include "gin/arguments.h" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 weak_factory_(this) {} | 164 weak_factory_(this) {} |
165 | 165 |
166 TextInputController::~TextInputController() {} | 166 TextInputController::~TextInputController() {} |
167 | 167 |
168 void TextInputController::Install(blink::WebLocalFrame* frame) { | 168 void TextInputController::Install(blink::WebLocalFrame* frame) { |
169 TextInputControllerBindings::Install(weak_factory_.GetWeakPtr(), frame); | 169 TextInputControllerBindings::Install(weak_factory_.GetWeakPtr(), frame); |
170 } | 170 } |
171 | 171 |
172 void TextInputController::InsertText(const std::string& text) { | 172 void TextInputController::InsertText(const std::string& text) { |
173 if (auto* controller = GetInputMethodController()) { | 173 if (auto* controller = GetInputMethodController()) { |
174 controller->commitText(blink::WebString::fromUTF8(text), 0); | 174 controller->commitText(blink::WebString::fromUTF8(text), |
| 175 std::vector<blink::WebCompositionUnderline>(), 0); |
175 } | 176 } |
176 } | 177 } |
177 | 178 |
178 void TextInputController::UnmarkText() { | 179 void TextInputController::UnmarkText() { |
179 if (auto* controller = GetInputMethodController()) { | 180 if (auto* controller = GetInputMethodController()) { |
180 controller->finishComposingText( | 181 controller->finishComposingText( |
181 blink::WebInputMethodController::KeepSelection); | 182 blink::WebInputMethodController::KeepSelection); |
182 } | 183 } |
183 } | 184 } |
184 | 185 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 | 334 |
334 blink::WebLocalFrame* mainFrame = view()->mainFrame()->toWebLocalFrame(); | 335 blink::WebLocalFrame* mainFrame = view()->mainFrame()->toWebLocalFrame(); |
335 if (!mainFrame) { | 336 if (!mainFrame) { |
336 CHECK(false) << "WebView does not have a local main frame and" | 337 CHECK(false) << "WebView does not have a local main frame and" |
337 " cannot handle input method controller tasks."; | 338 " cannot handle input method controller tasks."; |
338 } | 339 } |
339 return mainFrame->frameWidget()->getActiveWebInputMethodController(); | 340 return mainFrame->frameWidget()->getActiveWebInputMethodController(); |
340 } | 341 } |
341 | 342 |
342 } // namespace test_runner | 343 } // namespace test_runner |
OLD | NEW |