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

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: fsamuel's review fix 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 0bc0f04e9e05cc27ef665189b1e7c15276a19882..ce2ebc045234c37beb5ac0c0cc2729ad3517f377 100644
--- a/content/renderer/browser_plugin/browser_plugin.cc
+++ b/content/renderer/browser_plugin/browser_plugin.cc
@@ -37,6 +37,7 @@
#include "third_party/WebKit/public/web/WebPluginParams.h"
#include "third_party/WebKit/public/web/WebScriptSource.h"
#include "third_party/WebKit/public/web/WebView.h"
+#include "third_party/WebKit/public/web/WebWidget.h"
#include "ui/events/keycodes/keyboard_codes.h"
#if defined (OS_WIN)
@@ -965,6 +966,10 @@ bool BrowserPlugin::supportsEditCommands() const {
return true;
}
+bool BrowserPlugin::supportsInputMethod() const {
+ return true;
+}
+
bool BrowserPlugin::canProcessDrag() const {
return true;
}
@@ -1317,6 +1322,43 @@ 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::OnLockMouseACK(bool succeeded) {
mouse_locked_ = succeeded;
browser_plugin_manager()->Send(new BrowserPluginHostMsg_LockMouse_ACK(

Powered by Google App Engine
This is Rietveld 408576698