Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: components/test_runner/text_input_controller.cc

Issue 2568093003: Support parsing BackgroundSpans and UnderlineSpans in Android IME's commitText() (Closed)
Patch Set: Use addCompositionUnderlines() where I said I couldn't Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/browser_plugin/browser_plugin_guest.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | content/browser/browser_plugin/browser_plugin_guest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698