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

Side by Side Diff: content/renderer/browser_plugin/browser_plugin.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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "content/renderer/browser_plugin/browser_plugin.h" 5 #include "content/renderer/browser_plugin/browser_plugin.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 return true; 540 return true;
541 } 541 }
542 542
543 bool BrowserPlugin::setComposition( 543 bool BrowserPlugin::setComposition(
544 const blink::WebString& text, 544 const blink::WebString& text,
545 const blink::WebVector<blink::WebCompositionUnderline>& underlines, 545 const blink::WebVector<blink::WebCompositionUnderline>& underlines,
546 int selectionStart, 546 int selectionStart,
547 int selectionEnd) { 547 int selectionEnd) {
548 if (!attached()) 548 if (!attached())
549 return false; 549 return false;
550
550 std::vector<blink::WebCompositionUnderline> std_underlines; 551 std::vector<blink::WebCompositionUnderline> std_underlines;
551 for (size_t i = 0; i < underlines.size(); ++i) { 552 for (size_t i = 0; i < underlines.size(); ++i) {
552 std_underlines.push_back(underlines[i]); 553 std_underlines.push_back(underlines[i]);
553 } 554 }
555
554 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_ImeSetComposition( 556 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_ImeSetComposition(
555 browser_plugin_instance_id_, 557 browser_plugin_instance_id_,
556 text.utf8(), 558 text.utf8(),
557 std_underlines, 559 std_underlines,
558 selectionStart, 560 selectionStart,
559 selectionEnd)); 561 selectionEnd));
560 // TODO(kochi): This assumes the IPC handling always succeeds. 562 // TODO(kochi): This assumes the IPC handling always succeeds.
561 return true; 563 return true;
562 } 564 }
563 565
564 bool BrowserPlugin::commitText(const blink::WebString& text, 566 bool BrowserPlugin::commitText(
565 int relative_cursor_pos) { 567 const blink::WebString& text,
568 const blink::WebVector<blink::WebCompositionUnderline>& underlines,
569 int relative_cursor_pos) {
566 if (!attached()) 570 if (!attached())
567 return false; 571 return false;
568 572
573 std::vector<blink::WebCompositionUnderline> std_underlines;
574 for (size_t i = 0; i < underlines.size(); ++i) {
575 std_underlines.push_back(std_underlines[i]);
576 }
577
569 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_ImeCommitText( 578 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_ImeCommitText(
570 browser_plugin_instance_id_, text.utf8(), relative_cursor_pos)); 579 browser_plugin_instance_id_, text.utf8(), std_underlines,
580 relative_cursor_pos));
571 // TODO(kochi): This assumes the IPC handling always succeeds. 581 // TODO(kochi): This assumes the IPC handling always succeeds.
572 return true; 582 return true;
573 } 583 }
574 584
575 bool BrowserPlugin::finishComposingText( 585 bool BrowserPlugin::finishComposingText(
576 blink::WebInputMethodController::ConfirmCompositionBehavior 586 blink::WebInputMethodController::ConfirmCompositionBehavior
577 selection_behavior) { 587 selection_behavior) {
578 if (!attached()) 588 if (!attached())
579 return false; 589 return false;
580 bool keep_selection = 590 bool keep_selection =
(...skipping 29 matching lines...) Expand all
610 620
611 bool BrowserPlugin::HandleMouseLockedInputEvent( 621 bool BrowserPlugin::HandleMouseLockedInputEvent(
612 const blink::WebMouseEvent& event) { 622 const blink::WebMouseEvent& event) {
613 BrowserPluginManager::Get()->Send( 623 BrowserPluginManager::Get()->Send(
614 new BrowserPluginHostMsg_HandleInputEvent(browser_plugin_instance_id_, 624 new BrowserPluginHostMsg_HandleInputEvent(browser_plugin_instance_id_,
615 &event)); 625 &event));
616 return true; 626 return true;
617 } 627 }
618 628
619 } // namespace content 629 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/browser_plugin/browser_plugin.h ('k') | content/renderer/pepper/pepper_plugin_instance_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698