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

Unified Diff: content/renderer/browser_plugin/browser_plugin.cc

Issue 2568093003: Support parsing BackgroundSpans and UnderlineSpans in Android IME's commitText() (Closed)
Patch Set: Fix header include Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/browser_plugin/browser_plugin.cc
diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc
index a96612fc14eb7b99c826632b3b4f8a9b2a12ebc8..08e66b48147f77b2b6a4b8ee54375bbd9fe9170d 100644
--- a/content/renderer/browser_plugin/browser_plugin.cc
+++ b/content/renderer/browser_plugin/browser_plugin.cc
@@ -547,10 +547,12 @@ bool BrowserPlugin::setComposition(
int selectionEnd) {
if (!attached())
return false;
+
std::vector<blink::WebCompositionUnderline> std_underlines;
for (size_t i = 0; i < underlines.size(); ++i) {
std_underlines.push_back(underlines[i]);
}
+
BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_ImeSetComposition(
browser_plugin_instance_id_,
text.utf8(),
@@ -561,13 +563,21 @@ bool BrowserPlugin::setComposition(
return true;
}
-bool BrowserPlugin::commitText(const blink::WebString& text,
- int relative_cursor_pos) {
+bool BrowserPlugin::commitText(
+ const blink::WebString& text,
+ const blink::WebVector<blink::WebCompositionUnderline>& underlines,
+ int relative_cursor_pos) {
if (!attached())
return false;
+ std::vector<blink::WebCompositionUnderline> std_underlines;
+ for (size_t i = 0; i < underlines.size(); ++i) {
+ std_underlines.push_back(std_underlines[i]);
+ }
+
BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_ImeCommitText(
- browser_plugin_instance_id_, text.utf8(), relative_cursor_pos));
+ browser_plugin_instance_id_, text.utf8(), std_underlines,
+ relative_cursor_pos));
// TODO(kochi): This assumes the IPC handling always succeeds.
return true;
}

Powered by Google App Engine
This is Rietveld 408576698