| 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 weak_factory_(this) {} | 163 weak_factory_(this) {} |
| 164 | 164 |
| 165 TextInputController::~TextInputController() {} | 165 TextInputController::~TextInputController() {} |
| 166 | 166 |
| 167 void TextInputController::Install(blink::WebLocalFrame* frame) { | 167 void TextInputController::Install(blink::WebLocalFrame* frame) { |
| 168 TextInputControllerBindings::Install(weak_factory_.GetWeakPtr(), frame); | 168 TextInputControllerBindings::Install(weak_factory_.GetWeakPtr(), frame); |
| 169 } | 169 } |
| 170 | 170 |
| 171 void TextInputController::InsertText(const std::string& text) { | 171 void TextInputController::InsertText(const std::string& text) { |
| 172 if (auto* controller = GetInputMethodController()) { | 172 if (auto* controller = GetInputMethodController()) { |
| 173 controller->commitText(blink::WebString::fromUTF8(text), 0); | 173 controller->commitText(blink::WebString::fromUTF8(text), |
| 174 std::vector<blink::WebCompositionUnderline>(), 0); |
| 174 } | 175 } |
| 175 } | 176 } |
| 176 | 177 |
| 177 void TextInputController::UnmarkText() { | 178 void TextInputController::UnmarkText() { |
| 178 if (auto* controller = GetInputMethodController()) { | 179 if (auto* controller = GetInputMethodController()) { |
| 179 controller->finishComposingText( | 180 controller->finishComposingText( |
| 180 blink::WebInputMethodController::KeepSelection); | 181 blink::WebInputMethodController::KeepSelection); |
| 181 } | 182 } |
| 182 } | 183 } |
| 183 | 184 |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 | 332 |
| 332 blink::WebLocalFrame* mainFrame = view()->mainFrame()->toWebLocalFrame(); | 333 blink::WebLocalFrame* mainFrame = view()->mainFrame()->toWebLocalFrame(); |
| 333 if (!mainFrame) { | 334 if (!mainFrame) { |
| 334 CHECK(false) << "WebView does not have a local main frame and" | 335 CHECK(false) << "WebView does not have a local main frame and" |
| 335 " cannot handle input method controller tasks."; | 336 " cannot handle input method controller tasks."; |
| 336 } | 337 } |
| 337 return mainFrame->frameWidget()->getActiveWebInputMethodController(); | 338 return mainFrame->frameWidget()->getActiveWebInputMethodController(); |
| 338 } | 339 } |
| 339 | 340 |
| 340 } // namespace test_runner | 341 } // namespace test_runner |
| OLD | NEW |