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

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

Issue 103403006: Implement Input Method related WebPlugin interface for browser plugin (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Translate coordinates of parameter for ImeCompositionRangeChanged Created 7 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 ee32176a70ae9aa2bb1c0a9cb0555813d7545963..5f88fe142f983c74d932b0af5751c0780b168056 100644
--- a/content/renderer/browser_plugin/browser_plugin.cc
+++ b/content/renderer/browser_plugin/browser_plugin.cc
@@ -984,6 +984,10 @@ bool BrowserPlugin::supportsEditCommands() const {
return true;
}
+bool BrowserPlugin::supportsInputMethod() const {
+ return true;
+}
+
bool BrowserPlugin::canProcessDrag() const {
return true;
}
@@ -1337,6 +1341,54 @@ bool BrowserPlugin::executeEditCommand(const blink::WebString& name,
return true;
}
+bool BrowserPlugin::setComposition(
+ const blink::WebString& text,
+ const blink::WebVector<blink::WebCompositionUnderline>& underlines,
+ int selectionStart,
+ int selectionEnd) {
+ if (!HasGuestInstanceID())
+ return false;
+ std::vector<blink::WebCompositionUnderline> std_underlines;
+ for (size_t i = 0; i < underlines.size(); ++i) {
+ std_underlines.push_back(underlines[i]);
+ }
+ browser_plugin_manager()->Send(new BrowserPluginHostMsg_ImeSetComposition(
+ render_view_routing_id_,
+ guest_instance_id_,
+ text.utf8(),
+ std_underlines,
+ selectionStart,
+ selectionEnd));
+ // TODO(kochi): This assumes the IPC handling always succeeds.
+ return true;
+}
+
+bool BrowserPlugin::confirmComposition(
+ const blink::WebString& text,
+ blink::WebWidget::ConfirmCompositionBehavior selectionBehavior) {
+ if (!HasGuestInstanceID())
+ return false;
+ bool keep_selection = (selectionBehavior == blink::WebWidget::KeepSelection);
+ browser_plugin_manager()->Send(new BrowserPluginHostMsg_ImeConfirmComposition(
+ render_view_routing_id_,
+ guest_instance_id_,
+ text.utf8(),
+ keep_selection));
+ // TODO(kochi): This assumes the IPC handling always succeeds.
+ return true;
+}
+
+void BrowserPlugin::extendSelectionAndDelete(int before, int after) {
+ if (!HasGuestInstanceID())
+ return;
+ browser_plugin_manager()->Send(
+ new BrowserPluginHostMsg_ExtendSelectionAndDelete(
+ render_view_routing_id_,
+ guest_instance_id_,
+ before,
+ after));
+}
+
void BrowserPlugin::OnLockMouseACK(bool succeeded) {
mouse_locked_ = succeeded;
browser_plugin_manager()->Send(new BrowserPluginHostMsg_LockMouse_ACK(

Powered by Google App Engine
This is Rietveld 408576698