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

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: add cancel/compositionrangechanged 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..11d4bb0ec480bd56622584a1d355df6c38be4217 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,39 @@ 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) {
Fady Samuel 2013/12/10 17:55:32 if (!HasGuestInstanceID()) return false;
kochi 2013/12/11 01:35:21 Done. Thanks for pointing out.
+ 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) {
Fady Samuel 2013/12/10 17:55:32 if (!HasGuestInstanceID()) return false;
kochi 2013/12/11 01:35:21 Done.
+ 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