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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 // GetLocalPathsOnFileThreadAndRunCallbackOnUIThread() | 561 // GetLocalPathsOnFileThreadAndRunCallbackOnUIThread() |
563 void GetLocalPathsResponseOnUIThread(const SelectedFileInfoList& files); | 562 void GetLocalPathsResponseOnUIThread(const SelectedFileInfoList& files); |
564 | 563 |
565 // Helper callback for handling response from GDataFileSystem::TransferFile(). | 564 // Helper callback for handling response from GDataFileSystem::TransferFile(). |
566 void OnTransferCompleted(base::PlatformFileError error); | 565 void OnTransferCompleted(base::PlatformFileError error); |
567 | 566 |
568 DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.transferFile"); | 567 DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.transferFile"); |
569 }; | 568 }; |
570 | 569 |
571 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_PRIVATE_API_H_ | 570 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_PRIVATE_API_H_ |
OLD | NEW |