summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authormichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-13 19:31:47 +0000
committermichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-13 19:31:47 +0000
commit0582493ed8a6aa530c16acffb2cf2bae4bfd955f (patch)
tree5f6de3e3200263e654fba590ab3ca28779399a72 /chrome
parent0167204bc9a6f6873af4b92c8f0969d5ae465088 (diff)
downloadchromium_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')
-rw-r--r--chrome/browser/chrome_plugin_host.cc16
-rw-r--r--chrome/common/chrome_plugin_api.h35
-rw-r--r--chrome/common/plugin_messages_internal.h11
-rw-r--r--chrome/plugin/chrome_plugin_host.cc37
-rw-r--r--chrome/plugin/webplugin_proxy.cc52
-rw-r--r--chrome/plugin/webplugin_proxy.h10
-rw-r--r--chrome/renderer/webplugin_delegate_proxy.cc59
-rw-r--r--chrome/renderer/webplugin_delegate_proxy.h6
8 files changed, 3 insertions, 223 deletions
diff --git a/chrome/browser/chrome_plugin_host.cc b/chrome/browser/chrome_plugin_host.cc
index 0d21cdd..08ad7e7 100644
--- a/chrome/browser/chrome_plugin_host.cc
+++ b/chrome/browser/chrome_plugin_host.cc
@@ -527,20 +527,6 @@ CPError STDCALL CPB_HandleCommand(
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) {
- *identity = *event_id = 0;
- NOTREACHED() << "Should not be called in browser process.";
- return CPERR_FAILURE;
-}
-
-CPError STDCALL CPB_SetDropEffect(
- CPID id, CPBrowsingContext context, struct NPObject* event, int effect) {
- NOTREACHED() << "Should not be called in browser process.";
- return CPERR_FAILURE;
-}
-
//
// Functions related to network interception
//
@@ -782,8 +768,6 @@ CPBrowserFuncs* GetCPBrowserFuncsForBrowser() {
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;
request_funcs.size = sizeof(request_funcs);
request_funcs.start_request = CPR_StartRequest;
diff --git a/chrome/common/chrome_plugin_api.h b/chrome/common/chrome_plugin_api.h
index c10985a..384e9c2 100644
--- a/chrome/common/chrome_plugin_api.h
+++ b/chrome/common/chrome_plugin_api.h
@@ -30,7 +30,7 @@ extern "C" {
// The current version of the API, used by the 'version' field of CPPluginFuncs
// and CPBrowserFuncs.
#define CP_MAJOR_VERSION 0
-#define CP_MINOR_VERSION 10
+#define CP_MINOR_VERSION 9
#define CP_VERSION ((CP_MAJOR_VERSION << 8) | (CP_MINOR_VERSION))
#define CP_GET_MAJOR_VERSION(version) ((version & 0xff00) >> 8)
@@ -414,37 +414,6 @@ typedef void (STDCALL *CPP_OnFileDialogResultFunc)(void *data,
const char **files,
uint32 files_len);
-// Asks the browser to verify that NPObject* 'event' is the current drag event
-// the browser is dispatching, and extract drag data from the event if so. On
-// success, returns the drag 'identity' (an up-counter that the browser chrome
-// increases each time a user drag enters a renderer tab), the drag 'event_id'
-// and the 'drag_type' being a utf8 encoded string with values "Files", "Text"
-// or "URL". If 'add_data' is true, also return the 'drag_data', again a utf8
-// encoded string with the data for the drag type. For drag type "Files", the
-// data is a backspace delimited list of file paths.
-//
-// The call fails with a CPError if 'event' is an invalid drag event, and sets
-// the 'identity' and 'event_id' to 0. Note: on success, non-NULL 'drag_type'
-// and 'drag_data' should be freed with CPB_Free() when done.
-typedef CPError (STDCALL *CPB_GetDragDataFunc)(
- CPID id, CPBrowsingContext context, struct NPObject* event, bool add_data,
- int32* identity, int32* event_id, char** drag_type, char** drag_data);
-
-// Asks the browser to verify that NPObject* 'event' is the current drag event
-// the browser is dispatching and show the requested drop 'effect' if so. The
-// browser displays drop effects during dragenter and dragover events, to give
-// user visible feedback (with a drag cursor, typically) to indicate whether a
-// subsequent drop event will succeed or not. The implementation supports the
-// so-called "copy" and "none" effects. When 'effect' is non-zero, the "copy"
-// effect is shown. Otherwise, the "none" effect is shown, which prevents the
-// subsequent drop event from succeeding. Returns CPError on failure, meaning
-// the 'event' is an invalid drag event.
-//
-// Note: 'effect' is int to allow for new effects in future. For example, the
-// HTML5-defined drop effects "move" and "link".
-typedef CPError (STDCALL *CPB_SetDropEffectFunc)(
- CPID id, CPBrowsingContext context, struct NPObject* event, int effect);
-
// Function table for issuing requests using via the other side's network stack.
// For the plugin, this functions deal with issuing requests through the
// browser. For the browser, these functions deal with allowing the plugin to
@@ -519,8 +488,6 @@ typedef struct _CPBrowserFuncs {
CPB_SendSyncMessageFunc send_sync_message;
CPB_PluginThreadAsyncCallFunc plugin_thread_async_call;
CPB_OpenFileDialogFunc open_file_dialog;
- CPB_GetDragDataFunc get_drag_data;
- CPB_SetDropEffectFunc set_drop_effect;
} CPBrowserFuncs;
diff --git a/chrome/common/plugin_messages_internal.h b/chrome/common/plugin_messages_internal.h
index 25e7b5a..ed2e219 100644
--- a/chrome/common/plugin_messages_internal.h
+++ b/chrome/common/plugin_messages_internal.h
@@ -261,17 +261,6 @@ IPC_BEGIN_MESSAGES(PluginHost)
std::string /* json_arguments */,
std::string /* json_retval */)
- IPC_SYNC_MESSAGE_ROUTED2_2(PluginHostMsg_GetDragData,
- NPVariant_Param /* event */,
- bool /* add_data */,
- std::vector<NPVariant_Param> /* result_values */,
- bool /* result_success */)
-
- IPC_SYNC_MESSAGE_ROUTED2_1(PluginHostMsg_SetDropEffect,
- NPVariant_Param /* event */,
- int /* effect */,
- bool /* result_success */)
-
IPC_MESSAGE_ROUTED1(PluginHostMsg_MissingPluginStatus,
int /* status */)
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
diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc
index a9cb138..4e05f1d 100644
--- a/chrome/renderer/webplugin_delegate_proxy.cc
+++ b/chrome/renderer/webplugin_delegate_proxy.cc
@@ -23,7 +23,6 @@
#include "chrome/common/render_messages.h"
#include "chrome/plugin/npobject_proxy.h"
#include "chrome/plugin/npobject_stub.h"
-#include "chrome/plugin/npobject_util.h"
#include "chrome/renderer/render_thread.h"
#include "chrome/renderer/render_view.h"
#include "googleurl/src/gurl.h"
@@ -340,8 +339,6 @@ void WebPluginDelegateProxy::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(PluginHostMsg_GetCookies, OnGetCookies)
IPC_MESSAGE_HANDLER(PluginHostMsg_ShowModalHTMLDialog,
OnShowModalHTMLDialog)
- IPC_MESSAGE_HANDLER(PluginHostMsg_GetDragData, OnGetDragData);
- IPC_MESSAGE_HANDLER(PluginHostMsg_SetDropEffect, OnSetDropEffect);
IPC_MESSAGE_HANDLER(PluginHostMsg_MissingPluginStatus,
OnMissingPluginStatus)
IPC_MESSAGE_HANDLER(PluginHostMsg_URLRequest, OnHandleURLRequest)
@@ -729,58 +726,6 @@ void WebPluginDelegateProxy::OnShowModalHTMLDialog(
json_retval);
}
-void WebPluginDelegateProxy::OnGetDragData(const NPVariant_Param& object,
- bool add_data,
- std::vector<NPVariant_Param>* values,
- bool* success) {
- DCHECK(values && success);
- *success = false;
-
- WebView* webview = NULL;
- if (render_view_)
- webview = render_view_->webview();
- if (!webview)
- return;
-
- NPVariant results[4];
- NPObject* event = reinterpret_cast<NPObject*>(object.npobject_pointer);
- const int32 drag_id = webview->GetDragIdentity();
- if (!drag_id || !webkit_glue::GetDragData(event, add_data, &results[1]))
- return;
-
- INT32_TO_NPVARIANT(drag_id, results[0]);
- values->push_back(NPVariant_Param());
- CreateNPVariantParam(results[0], NULL, &values->back(), false, NULL);
- values->push_back(NPVariant_Param());
- CreateNPVariantParam(results[1], NULL, &values->back(), false, NULL);
- values->push_back(NPVariant_Param());
- CreateNPVariantParam(results[2], NULL, &values->back(), false, NULL);
- values->push_back(NPVariant_Param());
- CreateNPVariantParam(results[3], NULL, &values->back(), add_data, NULL);
-
- *success = true;
-}
-
-void WebPluginDelegateProxy::OnSetDropEffect(const NPVariant_Param& object,
- int effect,
- bool* success) {
- DCHECK(success);
- *success = false;
-
- WebView* webview = NULL;
- if (render_view_)
- webview = render_view_->webview();
- if (!webview)
- return;
-
- NPObject* event = reinterpret_cast<NPObject*>(object.npobject_pointer);
- const int32 drag_id = webview->GetDragIdentity();
- if (!drag_id || !webkit_glue::IsDragEvent(event))
- return;
-
- *success = webview->SetDropEffect(effect != 0);
-}
-
void WebPluginDelegateProxy::OnMissingPluginStatus(int status) {
if (render_view_)
render_view_->OnMissingPluginStatus(this, status);
@@ -880,8 +825,8 @@ void WebPluginDelegateProxy::OnCancelDocumentLoad() {
}
void WebPluginDelegateProxy::OnInitiateHTTPRangeRequest(
- const std::string& url, const std::string& range_info,
- intptr_t existing_stream, bool notify_needed, intptr_t notify_data) {
+ const std::string& url, const std::string& range_info,
+ intptr_t existing_stream, bool notify_needed, intptr_t notify_data) {
plugin_->InitiateHTTPRangeRequest(url.c_str(), range_info.c_str(),
existing_stream, notify_needed,
notify_data);
diff --git a/chrome/renderer/webplugin_delegate_proxy.h b/chrome/renderer/webplugin_delegate_proxy.h
index 6baa42a..99bd1e1 100644
--- a/chrome/renderer/webplugin_delegate_proxy.h
+++ b/chrome/renderer/webplugin_delegate_proxy.h
@@ -6,7 +6,6 @@
#define CHROME_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H__
#include <string>
-#include <vector>
#include "base/gfx/rect.h"
#include "base/gfx/native_widget_types.h"
@@ -20,7 +19,6 @@
class GURL;
struct NPObject;
class NPObjectStub;
-struct NPVariant_Param;
struct PluginHostMsg_URLRequest_Params;
class RenderView;
class SkBitmap;
@@ -127,10 +125,6 @@ class WebPluginDelegateProxy : public WebPluginDelegate,
void OnShowModalHTMLDialog(const GURL& url, int width, int height,
const std::string& json_arguments,
std::string* json_retval);
- void OnGetDragData(const NPVariant_Param& event, bool add_data,
- std::vector<NPVariant_Param>* values, bool* success);
- void OnSetDropEffect(const NPVariant_Param& event, int effect,
- bool* success);
void OnMissingPluginStatus(int status);
void OnGetCPBrowsingContext(uint32* context);
void OnCancelDocumentLoad();