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

Unified Diff: chrome/browser/chromeos/extensions/file_browser_handler_api.h

Issue 10664002: Add support for drive files to chrome.fileBrowserHandler.selectFile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 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 | « no previous file | chrome/browser/chromeos/extensions/file_browser_handler_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/extensions/file_browser_handler_api.h
diff --git a/chrome/browser/chromeos/extensions/file_browser_handler_api.h b/chrome/browser/chromeos/extensions/file_browser_handler_api.h
index 74ca9bcd9c74d1639fe0eb5021579f1c93b97246..2229b360e8cd3860f0b5380ba025f05b3d95e150 100644
--- a/chrome/browser/chromeos/extensions/file_browser_handler_api.h
+++ b/chrome/browser/chromeos/extensions/file_browser_handler_api.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_HANDLER_API_H_
#include <string>
+#include <vector>
#include "base/file_path.h"
#include "chrome/browser/extensions/extension_function.h"
@@ -51,20 +52,23 @@ class FileHandlerSelectFileFunction : public AsyncExtensionFunction {
virtual bool RunImpl() OVERRIDE;
private:
- // Calls |DoCreateFile| on file thread and invokes the callback.
- void CreateFileOnFileThread(bool success,
- const std::string& file_system_name,
- const GURL& file_system_root);
+ typedef base::Callback<void(const FilePath& virtual_path)>
+ GrantPermissionsCallback;
// Called on UI thread after the file gets created.
- void OnFileCreated(bool success,
- const std::string& file_system_name,
- const GURL& file_system_root);
+ void OnFileSystemOpened(bool success,
+ const std::string& file_system_name,
+ const GURL& file_system_root);
// Grants file access permissions for the created file to the extension with
// cros mount point provider and child process security policy.
- // Returns virtual path for which has been given permission.
- FilePath GrantPermissions();
+ void GrantPermissions(const GrantPermissionsCallback& callback);
+
+ // Callback called when we collect all paths and permissions that should be
+ // given to the caller render process in order for it to normally access file.
+ void OnGotPermissionsToGrant(
+ const GrantPermissionsCallback& callback,
+ const FilePath& virtual_path);
// Sends response to the extension.
void Respond(bool success,
@@ -79,6 +83,10 @@ class FileHandlerSelectFileFunction : public AsyncExtensionFunction {
// Full file system path of the selected file.
FilePath full_path_;
+ // List of permissions and paths that have to be granted for the selected
+ // files.
+ std::vector<std::pair<FilePath, int> > permissions_to_grant_;
+
// |file_selector_for_test_| and |disable_geture_check_for_test_| are used
// primary in testing to override file selector to be used in the function
// implementation and disable user gesture check.
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/file_browser_handler_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698