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

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
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_file_browser_private_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_file_browser_private_api.h
===================================================================
--- chrome/browser/extensions/extension_file_browser_private_api.h (revision 81868)
+++ chrome/browser/extensions/extension_file_browser_private_api.h (working copy)
@@ -13,29 +13,62 @@
#include "base/platform_file.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"
class GURL;
-// Implements the Chrome Extension local File API.
-class RequestLocalFileSystemFunction
- : public AsyncExtensionFunction {
- public:
- RequestLocalFileSystemFunction();
+// Implements the chrome.fileBrowserPrivate.requestLocalFileSystem method.
+class RequestLocalFileSystemFunction : public AsyncExtensionFunction {
+ protected:
+ friend class LocalFileSystemCallbackDispatcher;
+ // AsyncExtensionFunction overrides.
+ virtual bool RunImpl() OVERRIDE;
+ void RespondSuccessOnUIThread(const std::string& name,
+ const GURL& root_path);
+ void RespondFailedOnUIThread(base::PlatformFileError error_code);
+ void RequestOnFileThread(const GURL& source_url);
+ 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 GURL& root);
+ struct FileDefinition {
+ GURL target_file_url;
+ FilePath virtual_path;
+ bool is_directory;
+ };
+ typedef std::vector<FileDefinition> FileDefinitionList;
+ friend class ExecuteTasksFileSystemCallbackDispatcher;
+ // Initates execution of context menu tasks identified with |task_id| for
+ // each element of |files_list|.
+ bool InitiateFileTaskExecution(const std::string& task_id,
+ ListValue* files_list);
+ void RequestFileEntryOnFileThread(const GURL& source_url,
+ const std::string& task_id,
+ const std::vector<GURL>& file_urls);
void RespondFailedOnUIThread(base::PlatformFileError error_code);
-
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.requestLocalFileSystem");
+ void ExecuteFileActionsOnUIThread(const std::string& task_id,
+ const std::string& file_system_name,
+ const GURL& file_system_root,
+ const FileDefinitionList& file_list);
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.executeTask");
};
// Parent class for the chromium extension APIs for the file dialog.
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_file_browser_private_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698