Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / chromeos / extensions / file_manager / private_api_file_system.h
index b147db0..6209105 100644 (file)
@@ -23,6 +23,12 @@ namespace fileapi {
 class FileSystemContext;
 }
 
+namespace file_manager {
+namespace util {
+struct EntryDefinition;
+}  // namespace util
+}  // namespace file_manager
+
 namespace extensions {
 
 // Implements the chrome.fileBrowserPrivate.requestFileSystem method.
@@ -36,23 +42,28 @@ class FileBrowserPrivateRequestFileSystemFunction
   virtual ~FileBrowserPrivateRequestFileSystemFunction() {}
 
   // AsyncExtensionFunction overrides.
-  virtual bool RunImpl() OVERRIDE;
+  virtual bool RunAsync() OVERRIDE;
 
  private:
   void RespondSuccessOnUIThread(const std::string& name,
                                 const GURL& root_url);
-  void RespondFailedOnUIThread(base::PlatformFileError error_code);
+  void RespondFailedOnUIThread(base::File::Error error_code);
 
   // Called when something goes wrong. Records the error to |error_| per the
   // error code and reports that the private API function failed.
-  void DidFail(base::PlatformFileError error_code);
+  void DidFail(base::File::Error error_code);
 
   // Sets up file system access permissions to the extension identified by
   // |child_id|.
   bool SetupFileSystemAccessPermissions(
       scoped_refptr<fileapi::FileSystemContext> file_system_context,
       int child_id,
+      Profile* profile,
       scoped_refptr<const extensions::Extension> extension);
+
+  // Called when the entry definition is computed.
+  void OnEntryDefinition(
+      const file_manager::util::EntryDefinition& entry_definition);
 };
 
 // Base class for FileBrowserPrivateAddFileWatchFunction and
@@ -70,7 +81,7 @@ class FileWatchFunctionBase : public LoggedAsyncExtensionFunction {
       const std::string& extension_id) = 0;
 
   // AsyncExtensionFunction overrides.
-  virtual bool RunImpl() OVERRIDE;
+  virtual bool RunAsync() OVERRIDE;
 
   // Calls SendResponse() with |success| converted to base::Value.
   void Respond(bool success);
@@ -122,7 +133,7 @@ class FileBrowserPrivateGetSizeStatsFunction
   virtual ~FileBrowserPrivateGetSizeStatsFunction() {}
 
   // AsyncExtensionFunction overrides.
-  virtual bool RunImpl() OVERRIDE;
+  virtual bool RunAsync() OVERRIDE;
 
  private:
   void GetDriveAvailableSpaceCallback(drive::FileError error,
@@ -146,22 +157,22 @@ class FileBrowserPrivateValidatePathNameLengthFunction
   void OnFilePathLimitRetrieved(size_t current_length, size_t max_length);
 
   // AsyncExtensionFunction overrides.
-  virtual bool RunImpl() OVERRIDE;
+  virtual bool RunAsync() OVERRIDE;
 };
 
-// Implements the chrome.fileBrowserPrivate.formatDevice method.
-// Formats Device given its mount path.
-class FileBrowserPrivateFormatDeviceFunction
+// Implements the chrome.fileBrowserPrivate.formatVolume method.
+// Formats Volume given its mount path.
+class FileBrowserPrivateFormatVolumeFunction
     : public LoggedAsyncExtensionFunction {
  public:
-  DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.formatDevice",
-                             FILEBROWSERPRIVATE_FORMATDEVICE)
+  DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.formatVolume",
+                             FILEBROWSERPRIVATE_FORMATVOLUME)
 
  protected:
-  virtual ~FileBrowserPrivateFormatDeviceFunction() {}
+  virtual ~FileBrowserPrivateFormatVolumeFunction() {}
 
   // AsyncExtensionFunction overrides.
-  virtual bool RunImpl() OVERRIDE;
+  virtual bool RunAsync() OVERRIDE;
 };
 
 // Implements the chrome.fileBrowserPrivate.startCopy method.
@@ -175,10 +186,10 @@ class FileBrowserPrivateStartCopyFunction
   virtual ~FileBrowserPrivateStartCopyFunction() {}
 
   // AsyncExtensionFunction overrides.
-  virtual bool RunImpl() OVERRIDE;
+  virtual bool RunAsync() OVERRIDE;
 
  private:
-  // Part of RunImpl(). Called after Copy() is started on IO thread.
+  // Part of RunAsync(). Called after Copy() is started on IO thread.
   void RunAfterStartCopy(int operation_id);
 };
 
@@ -193,7 +204,7 @@ class FileBrowserPrivateCancelCopyFunction
   virtual ~FileBrowserPrivateCancelCopyFunction() {}
 
   // AsyncExtensionFunction overrides.
-  virtual bool RunImpl() OVERRIDE;
+  virtual bool RunAsync() OVERRIDE;
 };
 
 }  // namespace extensions