diff options
author | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-13 19:31:47 +0000 |
---|---|---|
committer | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-13 19:31:47 +0000 |
commit | 0582493ed8a6aa530c16acffb2cf2bae4bfd955f (patch) | |
tree | 5f6de3e3200263e654fba590ab3ca28779399a72 /chrome/plugin | |
parent | 0167204bc9a6f6873af4b92c8f0969d5ae465088 (diff) | |
download | chromium_src-0582493ed8a6aa530c16acffb2cf2bae4bfd955f.zip chromium_src-0582493ed8a6aa530c16acffb2cf2bae4bfd955f.tar.gz chromium_src-0582493ed8a6aa530c16acffb2cf2bae4bfd955f.tar.bz2 |
Reverting 15986.
Review URL: http://codereview.chromium.org/113359
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15987 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/plugin')
-rw-r--r-- | chrome/plugin/chrome_plugin_host.cc | 37 | ||||
-rw-r--r-- | chrome/plugin/webplugin_proxy.cc | 52 | ||||
-rw-r--r-- | chrome/plugin/webplugin_proxy.h | 10 |
3 files changed, 0 insertions, 99 deletions
diff --git a/chrome/plugin/chrome_plugin_host.cc b/chrome/plugin/chrome_plugin_host.cc index 4874e41..992afcf 100644 --- a/chrome/plugin/chrome_plugin_host.cc +++ b/chrome/plugin/chrome_plugin_host.cc @@ -313,41 +313,6 @@ CPError STDCALL CPB_ShowHtmlDialog( return CPERR_FAILURE; } -CPError STDCALL CPB_GetDragData( - CPID id, CPBrowsingContext context, struct NPObject* event, bool add_data, - int32 *identity, int32 *event_id, char **drag_type, char **drag_data) { - CHECK(ChromePluginLib::IsPluginThread()); - - *identity = *event_id = 0; - WebPluginProxy* webplugin = WebPluginProxy::FromCPBrowsingContext(context); - if (!event || !webplugin) - return CPERR_INVALID_PARAMETER; - - std::string type_str, data_str; - if (!webplugin->GetDragData(event, add_data, - identity, event_id, &type_str, &data_str)) { - return CPERR_FAILURE; - } - - if (add_data) - *drag_data = CPB_StringDup(CPB_Alloc, data_str); - *drag_type = CPB_StringDup(CPB_Alloc, type_str); - return CPERR_SUCCESS; -} - -CPError STDCALL CPB_SetDropEffect( - CPID id, CPBrowsingContext context, struct NPObject* event, int effect) { - CHECK(ChromePluginLib::IsPluginThread()); - - WebPluginProxy* webplugin = WebPluginProxy::FromCPBrowsingContext(context); - if (!event || !webplugin) - return CPERR_INVALID_PARAMETER; - - if (webplugin->SetDropEffect(event, effect)) - return CPERR_SUCCESS; - return CPERR_FAILURE; -} - CPError STDCALL CPB_GetCommandLineArguments( CPID id, CPBrowsingContext context, const char* url, char** arguments) { CHECK(ChromePluginLib::IsPluginThread()); @@ -632,8 +597,6 @@ CPBrowserFuncs* GetCPBrowserFuncsForPlugin() { browser_funcs.send_sync_message = CPB_SendSyncMessage; browser_funcs.plugin_thread_async_call = CPB_PluginThreadAsyncCall; browser_funcs.open_file_dialog = CPB_OpenFileDialog; - browser_funcs.get_drag_data = CPB_GetDragData; - browser_funcs.set_drop_effect = CPB_SetDropEffect; browser_funcs.request_funcs = &request_funcs; browser_funcs.response_funcs = &response_funcs; diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc index 6efff09..38f3af6 100644 --- a/chrome/plugin/webplugin_proxy.cc +++ b/chrome/plugin/webplugin_proxy.cc @@ -305,58 +305,6 @@ void WebPluginProxy::HandleURLRequest(const char *method, Send(new PluginHostMsg_URLRequest(route_id_, params)); } -bool WebPluginProxy::GetDragData(struct NPObject* event, bool add_data, - int32* identity, int32* event_id, - std::string* type, std::string* data) { - DCHECK(event); - NPObjectProxy* proxy = NPObjectProxy::GetProxy(event); - if (!proxy) // NPObject* event should have/be a renderer proxy. - return false; - - NPVariant_Param event_param; - event_param.type = NPVARIANT_PARAM_OBJECT_POINTER; - event_param.npobject_pointer = proxy->npobject_ptr(); - if (!event_param.npobject_pointer) - return false; - - std::vector<NPVariant_Param> values; - bool success = false; - Send(new PluginHostMsg_GetDragData(route_id_, event_param, add_data, - &values, &success)); - if (!success) - return false; - - DCHECK(values.size() == 4); - DCHECK(values[0].type == NPVARIANT_PARAM_INT); - *identity = static_cast<int32>(values[0].int_value); - DCHECK(values[1].type == NPVARIANT_PARAM_INT); - *event_id = static_cast<int32>(values[1].int_value); - DCHECK(values[2].type == NPVARIANT_PARAM_STRING); - type->swap(values[2].string_value); - if (add_data && (values[3].type == NPVARIANT_PARAM_STRING)) - data->swap(values[3].string_value); - - return true; -} - -bool WebPluginProxy::SetDropEffect(struct NPObject* event, int effect) { - DCHECK(event); - NPObjectProxy* proxy = NPObjectProxy::GetProxy(event); - if (!proxy) // NPObject* event should have/be a renderer proxy. - return false; - - NPVariant_Param event_param; - event_param.type = NPVARIANT_PARAM_OBJECT_POINTER; - event_param.npobject_pointer = proxy->npobject_ptr(); - if (!event_param.npobject_pointer) - return false; - - bool success = false; - Send(new PluginHostMsg_SetDropEffect(route_id_, event_param, effect, - &success)); - return success; -} - void WebPluginProxy::Paint(const gfx::Rect& rect) { #if defined(OS_WIN) if (!windowless_hdc_) diff --git a/chrome/plugin/webplugin_proxy.h b/chrome/plugin/webplugin_proxy.h index e5594f0..2822fa8 100644 --- a/chrome/plugin/webplugin_proxy.h +++ b/chrome/plugin/webplugin_proxy.h @@ -5,8 +5,6 @@ #ifndef CHROME_PLUGIN_PLUGIN_WEBPLUGIN_PROXY_H__ #define CHROME_PLUGIN_PLUGIN_WEBPLUGIN_PROXY_H__ -#include <string> - #include "base/hash_tables.h" #include "base/ref_counted.h" #include "base/scoped_handle.h" @@ -57,14 +55,6 @@ class WebPluginProxy : public WebPlugin { void ShowModalHTMLDialog(const GURL& url, int width, int height, const std::string& json_arguments, std::string* json_retval); - - // Called by gears over the CPAPI interface to verify that the given event is - // the current (javascript) drag event the browser is dispatching, and return - // the drag data, or control the drop effect (drag cursor), if so. - bool GetDragData(struct NPObject* event, bool add_data, int32* identity, - int32* event_id, std::string* type, std::string* data); - bool SetDropEffect(struct NPObject* event, int effect); - void OnMissingPluginStatus(int status); // class-specific methods |