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

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

Issue 2568093003: Support parsing BackgroundSpans and UnderlineSpans in Android IME's commitText() (Closed)
Patch Set: Don't try to add default underline for commitText(), attempt to fix Mac builds 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 248b36b1b203f00cdf854ae0652388790a3a634f..a5e80f483bbb594c82fb80f7966c83c4d04ccde8 100644
--- a/content/renderer/browser_plugin/browser_plugin.cc
+++ b/content/renderer/browser_plugin/browser_plugin.cc
@@ -546,10 +546,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(),
@@ -560,13 +562,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