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

Unified Diff: chrome/browser/extensions/extension_file_browser_private_api.h

Issue 6749021: Added new fileBrowserPrivate and fileHandler extension APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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
Index: chrome/browser/extensions/extension_file_browser_private_api.h
===================================================================
--- chrome/browser/extensions/extension_file_browser_private_api.h (revision 81212)
+++ chrome/browser/extensions/extension_file_browser_private_api.h (working copy)
@@ -13,27 +13,62 @@
#include "base/file_path.h"
#include "chrome/browser/extensions/extension_function.h"
#include "chrome/browser/ui/shell_dialogs.h"
+#include "googleurl/src/url_util.h"
#include "webkit/fileapi/file_system_callback_dispatcher.h"
-// Implements the Chrome Extension local File API.
+// Implements the chrome.fileBrowserPrivate.requestLocalFileSystem method.
+class RequestLocalFileSystemFunctionBase : public AsyncExtensionFunction {
+ protected:
+ friend class LocalFileSystemCallbackDispatcher;
+ // AsyncExtensionFunction overrides.
+ virtual bool RunImpl() OVERRIDE;
+ void RespondSuccessOnUIThread(const std::string& name,
+ const FilePath& root_path,
+ const GURL& file_url);
+ void RespondFailedOnUIThread(base::PlatformFileError error_code);
+ void RequestOnFileThread(const GURL& source_url, const GURL& file_url);
+};
+
+// Implements the chrome.fileBrowserPrivate.requestLocalFileSystem method.
class RequestLocalFileSystemFunction
- : public AsyncExtensionFunction {
- public:
- RequestLocalFileSystemFunction();
+ : public RequestLocalFileSystemFunctionBase {
+ private:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.requestLocalFileSystem");
+};
+// Implements the chrome.fileBrowserPrivate.getFileTasks method.
+class GetFileTasksFileBrowserFunction : public AsyncExtensionFunction {
protected:
- virtual ~RequestLocalFileSystemFunction();
+ // AsyncExtensionFunction overrides.
+ virtual bool RunImpl() OVERRIDE;
+ private:
+
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.getFileTasks");
+};
+
+
+// Implements the chrome.fileBrowserPrivate.executeTask method.
+class ExecuteTasksFileBrowserFunction : public AsyncExtensionFunction {
+ protected:
// AsyncExtensionFunction overrides.
virtual bool RunImpl() OVERRIDE;
private:
- friend class LocalFileSystemCallbackDispatcher;
- void RespondSuccessOnUIThread(const std::string& name,
- const FilePath& path);
- void RespondFailedOnUIThread(base::PlatformFileError error_code);
+ // Grants access for local file system element represented by
+ // |origin_file_url| from handler extension identified by
+ // |handler_extension_id|. It also modifies |origin_file_url| to make it
+ // usable within handler extension - replaces origin extension id with
+ // handlers's.
+ bool GrantLocalFileSystemAccess(const GURL& origin_file_url,
+ const std::string& handler_extension_id,
+ GURL* handler_file_url);
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.requestLocalFileSystem");
+ // Executes context menu tasks for each element of |files_list|.
+ bool ExecuteContextMenuTasks(const std::string& handler_extension_id,
+ const std::string& action_id,
+ ListValue* files_list);
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.executeTask");
};
// Parent class for the chromium extension APIs for the file dialog.

Powered by Google App Engine
This is Rietveld 408576698