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. |