diff options
author | bashi@chromium.org <bashi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-13 04:11:08 +0000 |
---|---|---|
committer | bashi@chromium.org <bashi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-13 04:11:08 +0000 |
commit | eeb3a533308c6a9ebe2206a57137c095bfbb2e01 (patch) | |
tree | 560972319ed77a48c35b1d00789c7ecb06b23e39 /content | |
parent | 34ed292032e794d0ae3ff2cf87e6e50d5dd152ea (diff) | |
download | chromium_src-eeb3a533308c6a9ebe2206a57137c095bfbb2e01.zip chromium_src-eeb3a533308c6a9ebe2206a57137c095bfbb2e01.tar.gz chromium_src-eeb3a533308c6a9ebe2206a57137c095bfbb2e01.tar.bz2 |
Getting form value from NPAPI plugins.
Adds/implements a plugin IPC message which allows to get form value from
plugins. We need to implement the interface on WebKit side to make this
work so the CL won't affect the chromium's behavior for now.
BUG=88896
TEST=compiled
Review URL: http://codereview.chromium.org/7335004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92315 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/common/plugin_messages.h | 5 | ||||
-rw-r--r-- | content/plugin/webplugin_delegate_stub.cc | 8 | ||||
-rw-r--r-- | content/plugin/webplugin_delegate_stub.h | 1 | ||||
-rw-r--r-- | content/renderer/webplugin_delegate_proxy.cc | 6 | ||||
-rw-r--r-- | content/renderer/webplugin_delegate_proxy.h | 1 |
5 files changed, 21 insertions, 0 deletions
diff --git a/content/common/plugin_messages.h b/content/common/plugin_messages.h index 136fa83..0b01cc8 100644 --- a/content/common/plugin_messages.h +++ b/content/common/plugin_messages.h @@ -183,6 +183,11 @@ IPC_MESSAGE_ROUTED0(PluginMsg_DidPaint) IPC_SYNC_MESSAGE_ROUTED0_1(PluginMsg_GetPluginScriptableObject, int /* route_id */) +// Gets the form value of the plugin instance synchronously. +IPC_SYNC_MESSAGE_ROUTED0_2(PluginMsg_GetFormValue, + string16 /* value */, + bool /* success */) + IPC_MESSAGE_ROUTED3(PluginMsg_DidFinishLoadWithReason, GURL /* url */, int /* reason */, diff --git a/content/plugin/webplugin_delegate_stub.cc b/content/plugin/webplugin_delegate_stub.cc index 9555313..00987b2 100644 --- a/content/plugin/webplugin_delegate_stub.cc +++ b/content/plugin/webplugin_delegate_stub.cc @@ -102,6 +102,7 @@ bool WebPluginDelegateStub::OnMessageReceived(const IPC::Message& msg) { IPC_MESSAGE_HANDLER(PluginMsg_DidPaint, OnDidPaint) IPC_MESSAGE_HANDLER(PluginMsg_GetPluginScriptableObject, OnGetPluginScriptableObject) + IPC_MESSAGE_HANDLER(PluginMsg_GetFormValue, OnGetFormValue) IPC_MESSAGE_HANDLER(PluginMsg_UpdateGeometry, OnUpdateGeometry) IPC_MESSAGE_HANDLER(PluginMsg_UpdateGeometrySync, OnUpdateGeometry) IPC_MESSAGE_HANDLER(PluginMsg_SendJavaScriptStream, @@ -292,6 +293,13 @@ void WebPluginDelegateStub::OnGetPluginScriptableObject(int* route_id) { WebBindings::releaseObject(object); } +void WebPluginDelegateStub::OnGetFormValue(string16* value, bool* success) { + *success = false; + if (!delegate_) + return; + *success = delegate_->GetFormValue(value); +} + void WebPluginDelegateStub::OnSendJavaScriptStream(const GURL& url, const std::string& result, bool success, diff --git a/content/plugin/webplugin_delegate_stub.h b/content/plugin/webplugin_delegate_stub.h index 629da0a..3c4610a 100644 --- a/content/plugin/webplugin_delegate_stub.h +++ b/content/plugin/webplugin_delegate_stub.h @@ -78,6 +78,7 @@ class WebPluginDelegateStub : public IPC::Channel::Listener, const std::string& result, bool success, int notify_id); + void OnGetFormValue(string16* value, bool* success); void OnSetContentAreaFocus(bool has_focus); #if defined(OS_MACOSX) diff --git a/content/renderer/webplugin_delegate_proxy.cc b/content/renderer/webplugin_delegate_proxy.cc index b6c3619..f6c3d9c 100644 --- a/content/renderer/webplugin_delegate_proxy.cc +++ b/content/renderer/webplugin_delegate_proxy.cc @@ -937,6 +937,12 @@ NPObject* WebPluginDelegateProxy::GetPluginScriptableObject() { return WebBindings::retainObject(npobject_); } +bool WebPluginDelegateProxy::GetFormValue(string16* value) { + bool success = false; + Send(new PluginMsg_GetFormValue(instance_id_, value, &success)); + return success; +} + void WebPluginDelegateProxy::DidFinishLoadWithReason( const GURL& url, NPReason reason, int notify_id) { Send(new PluginMsg_DidFinishLoadWithReason( diff --git a/content/renderer/webplugin_delegate_proxy.h b/content/renderer/webplugin_delegate_proxy.h index 7912436..3318140 100644 --- a/content/renderer/webplugin_delegate_proxy.h +++ b/content/renderer/webplugin_delegate_proxy.h @@ -71,6 +71,7 @@ class WebPluginDelegateProxy const gfx::Rect& clip_rect); virtual void Paint(WebKit::WebCanvas* canvas, const gfx::Rect& rect); virtual NPObject* GetPluginScriptableObject(); + virtual bool GetFormValue(string16* value); virtual void DidFinishLoadWithReason(const GURL& url, NPReason reason, int notify_id); virtual void SetFocus(bool focused); |