| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_PRIVATE_API_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_PRIVATE_API_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_PRIVATE_API_H_ | 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_PRIVATE_API_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 // Implements the chrome.fileBrowserPrivate.requestLocalFileSystem method. | 25 // Implements the chrome.fileBrowserPrivate.requestLocalFileSystem method. |
| 26 class RequestLocalFileSystemFunction : public AsyncExtensionFunction { | 26 class RequestLocalFileSystemFunction : public AsyncExtensionFunction { |
| 27 protected: | 27 protected: |
| 28 // AsyncExtensionFunction overrides. | 28 // AsyncExtensionFunction overrides. |
| 29 virtual bool RunImpl() OVERRIDE; | 29 virtual bool RunImpl() OVERRIDE; |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 class LocalFileSystemCallbackDispatcher; | 32 class LocalFileSystemCallbackDispatcher; |
| 33 | 33 |
| 34 // Adds gdata mount point. |
| 35 void AddGDataMountPoint(); |
| 36 |
| 34 void RespondSuccessOnUIThread(const std::string& name, | 37 void RespondSuccessOnUIThread(const std::string& name, |
| 35 const GURL& root_path); | 38 const GURL& root_path); |
| 36 void RespondFailedOnUIThread(base::PlatformFileError error_code); | 39 void RespondFailedOnUIThread(base::PlatformFileError error_code); |
| 37 void RequestOnFileThread(const GURL& source_url, int child_id); | 40 void RequestOnFileThread(const GURL& source_url, int child_id); |
| 38 DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.requestLocalFileSystem"); | 41 DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.requestLocalFileSystem"); |
| 39 }; | 42 }; |
| 40 | 43 |
| 41 // Implements the chrome.fileBrowserPrivate.addFileWatch method. | 44 // Implements the chrome.fileBrowserPrivate.addFileWatch method. |
| 42 class FileWatchBrowserFunctionBase : public AsyncExtensionFunction { | 45 class FileWatchBrowserFunctionBase : public AsyncExtensionFunction { |
| 43 protected: | 46 protected: |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 | 229 |
| 227 protected: | 230 protected: |
| 228 virtual ~AddMountFunction(); | 231 virtual ~AddMountFunction(); |
| 229 | 232 |
| 230 // AsyncExtensionFunction overrides. | 233 // AsyncExtensionFunction overrides. |
| 231 virtual bool RunImpl() OVERRIDE; | 234 virtual bool RunImpl() OVERRIDE; |
| 232 | 235 |
| 233 private: | 236 private: |
| 234 // Sends gdata mount event to renderers. | 237 // Sends gdata mount event to renderers. |
| 235 void RaiseGDataMountEvent(gdata::GDataErrorCode error); | 238 void RaiseGDataMountEvent(gdata::GDataErrorCode error); |
| 236 // Gives the extension renderer file permissions for the given path. | |
| 237 void GrantFilePermissionsToHost(const FilePath& path, int permissions); | |
| 238 // Adds gdata mount point. | |
| 239 void AddGDataMountPoint(); | |
| 240 // A callback method to handle the result of GData authentication request. | 239 // A callback method to handle the result of GData authentication request. |
| 241 void OnGDataAuthentication(gdata::GDataErrorCode error, | 240 void OnGDataAuthentication(gdata::GDataErrorCode error, |
| 242 const std::string& token); | 241 const std::string& token); |
| 243 // A callback method to handle the result of | 242 // A callback method to handle the result of |
| 244 // GetLocalPathsOnFileThreadAndRunCallbackOnUIThread. | 243 // GetLocalPathsOnFileThreadAndRunCallbackOnUIThread. |
| 245 void GetLocalPathsResponseOnUIThread(const std::string& mount_type_str, | 244 void GetLocalPathsResponseOnUIThread(const std::string& mount_type_str, |
| 246 const SelectedFileInfoList& files); | 245 const SelectedFileInfoList& files); |
| 247 | 246 |
| 248 DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.addMount"); | 247 DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.addMount"); |
| 249 }; | 248 }; |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 // GetLocalPathsOnFileThreadAndRunCallbackOnUIThread() | 534 // GetLocalPathsOnFileThreadAndRunCallbackOnUIThread() |
| 536 void GetLocalPathsResponseOnUIThread(const SelectedFileInfoList& files); | 535 void GetLocalPathsResponseOnUIThread(const SelectedFileInfoList& files); |
| 537 | 536 |
| 538 // Helper callback for handling response from GDataFileSystem::TransferFile(). | 537 // Helper callback for handling response from GDataFileSystem::TransferFile(). |
| 539 void OnTransferCompleted(base::PlatformFileError error); | 538 void OnTransferCompleted(base::PlatformFileError error); |
| 540 | 539 |
| 541 DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.transferFile"); | 540 DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.transferFile"); |
| 542 }; | 541 }; |
| 543 | 542 |
| 544 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_PRIVATE_API_H_ | 543 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_PRIVATE_API_H_ |
| OLD | NEW |