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

Unified Diff: chrome/plugin/chrome_plugin_host.cc

Issue 160211: Merge 21437 - CPAPI (0.11) for gears drag drop.... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/src/
Patch Set: Created 11 years, 5 months 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
« no previous file with comments | « chrome/common/plugin_messages_internal.h ('k') | chrome/plugin/webplugin_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/plugin/chrome_plugin_host.cc
===================================================================
--- chrome/plugin/chrome_plugin_host.cc (revision 21731)
+++ chrome/plugin/chrome_plugin_host.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -351,6 +351,33 @@
return CPERR_FAILURE;
}
+CPError STDCALL CPB_AllowFileDrop(
+ CPID id, CPBrowsingContext context, const char* file_drag_data) {
+ CHECK(ChromePluginLib::IsPluginThread());
+
+ WebPluginProxy* webplugin = WebPluginProxy::FromCPBrowsingContext(context);
+ if (!webplugin || !file_drag_data)
+ return CPERR_INVALID_PARAMETER;
+
+ const int pid = webplugin->GetRendererProcessId();
+ if (!pid)
+ return CPERR_FAILURE;
+
+ static const char kDelimiter('\b');
+ std::vector<std::string> files;
+ SplitStringDontTrim(file_drag_data, kDelimiter, &files);
+
+ bool allowed = false;
+ if (!PluginThread::current()->Send(
+ new PluginProcessHostMsg_AccessFiles(pid, files, &allowed))) {
+ return CPERR_FAILURE;
+ }
+
+ if (allowed)
+ return CPERR_SUCCESS;
+ return CPERR_FAILURE;
+}
+
CPError STDCALL CPB_GetCommandLineArguments(
CPID id, CPBrowsingContext context, const char* url, char** arguments) {
CHECK(ChromePluginLib::IsPluginThread());
@@ -636,6 +663,7 @@
browser_funcs.open_file_dialog = CPB_OpenFileDialog;
browser_funcs.get_drag_data = CPB_GetDragData;
browser_funcs.set_drop_effect = CPB_SetDropEffect;
+ browser_funcs.allow_file_drop = CPB_AllowFileDrop;
browser_funcs.request_funcs = &request_funcs;
browser_funcs.response_funcs = &response_funcs;
Property changes on: chrome\plugin\chrome_plugin_host.cc
___________________________________________________________________
Added: svn:mergeinfo
Merged /trunk/src/chrome/plugin/chrome_plugin_host.cc:r21437
Merged /branches/chrome_webkit_merge_branch/chrome/plugin/chrome_plugin_host.cc:r69-2775
« no previous file with comments | « chrome/common/plugin_messages_internal.h ('k') | chrome/plugin/webplugin_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698