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_GDATA_GDATA_FILE_SYSTEM_PROXY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_PROXY_H_ |
6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_PROXY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_PROXY_H_ |
7 | 7 |
8 #include "chrome/browser/chromeos/gdata/gdata_errorcode.h" | 8 #include "chrome/browser/chromeos/gdata/gdata_errorcode.h" |
9 #include "chrome/browser/chromeos/gdata/gdata_file_system_interface.h" | 9 #include "chrome/browser/chromeos/gdata/gdata_file_system_interface.h" |
10 #include "webkit/chromeos/fileapi/remote_file_system_proxy.h" | 10 #include "webkit/chromeos/fileapi/remote_file_system_proxy.h" |
11 | 11 |
12 namespace fileapi { | 12 namespace fileapi { |
13 class FileSystemURL; | 13 class FileSystemURL; |
14 } | 14 } |
15 | 15 |
| 16 class Profile; |
| 17 |
16 namespace gdata { | 18 namespace gdata { |
17 | 19 |
18 class GDataEntryProto; | 20 class GDataEntryProto; |
19 class GDataFileSystemInterface; | 21 class GDataFileSystemInterface; |
20 | 22 |
21 // Implementation of File API's remote file system proxy for GData file system. | 23 // Implementation of File API's remote file system proxy for GData file system. |
22 class GDataFileSystemProxy : public fileapi::RemoteFileSystemProxyInterface { | 24 class GDataFileSystemProxy : public fileapi::RemoteFileSystemProxyInterface { |
23 public: | 25 public: |
24 // |file_system| is the GDataFileSystem instance owned by GDataSystemService. | 26 // |file_system| is the GDataFileSystem instance owned by GDataSystemService. |
25 explicit GDataFileSystemProxy(GDataFileSystemInterface* file_system); | 27 explicit GDataFileSystemProxy(GDataFileSystemInterface* file_system, |
| 28 Profile* profile); |
26 | 29 |
27 // fileapi::RemoteFileSystemProxyInterface overrides. | 30 // fileapi::RemoteFileSystemProxyInterface overrides. |
28 virtual void GetFileInfo( | 31 virtual void GetFileInfo( |
29 const fileapi::FileSystemURL& url, | 32 const fileapi::FileSystemURL& url, |
30 const fileapi::FileSystemOperationInterface::GetMetadataCallback& | 33 const fileapi::FileSystemOperationInterface::GetMetadataCallback& |
31 callback) OVERRIDE; | 34 callback) OVERRIDE; |
32 virtual void Copy( | 35 virtual void Copy( |
33 const fileapi::FileSystemURL& src_url, | 36 const fileapi::FileSystemURL& src_url, |
34 const fileapi::FileSystemURL& dest_url, | 37 const fileapi::FileSystemURL& dest_url, |
35 const fileapi::FileSystemOperationInterface::StatusCallback& callback) | 38 const fileapi::FileSystemOperationInterface::StatusCallback& callback) |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 callback, | 113 callback, |
111 GDataFileError error, | 114 GDataFileError error, |
112 scoped_ptr<GDataEntryProto> entry_proto); | 115 scoped_ptr<GDataEntryProto> entry_proto); |
113 | 116 |
114 // Helper callback for relaying reply for ReadDirectory() to the calling | 117 // Helper callback for relaying reply for ReadDirectory() to the calling |
115 // thread. | 118 // thread. |
116 void OnReadDirectory( | 119 void OnReadDirectory( |
117 const fileapi::FileSystemOperationInterface::ReadDirectoryCallback& | 120 const fileapi::FileSystemOperationInterface::ReadDirectoryCallback& |
118 callback, | 121 callback, |
119 GDataFileError error, | 122 GDataFileError error, |
120 bool hide_hosted_documents, | |
121 scoped_ptr<gdata::GDataEntryProtoVector> proto_entries); | 123 scoped_ptr<gdata::GDataEntryProtoVector> proto_entries); |
122 | 124 |
123 // Helper callback for relaying reply for CreateWritableSnapshotFile() to | 125 // Helper callback for relaying reply for CreateWritableSnapshotFile() to |
124 // the calling thread. | 126 // the calling thread. |
125 void OnCreateWritableSnapshotFile( | 127 void OnCreateWritableSnapshotFile( |
126 const FilePath& virtual_path, | 128 const FilePath& virtual_path, |
127 const fileapi::WritableSnapshotFile& callback, | 129 const fileapi::WritableSnapshotFile& callback, |
128 GDataFileError result, | 130 GDataFileError result, |
129 const FilePath& local_path); | 131 const FilePath& local_path); |
130 | 132 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 base::ProcessHandle peer_handle, | 178 base::ProcessHandle peer_handle, |
177 const fileapi::FileSystemOperationInterface::OpenFileCallback& callback, | 179 const fileapi::FileSystemOperationInterface::OpenFileCallback& callback, |
178 base::PlatformFile* platform_file, | 180 base::PlatformFile* platform_file, |
179 base::PlatformFileError* truncate_result); | 181 base::PlatformFileError* truncate_result); |
180 | 182 |
181 // GDataFileSystem is owned by Profile, which outlives GDataFileSystemProxy, | 183 // GDataFileSystem is owned by Profile, which outlives GDataFileSystemProxy, |
182 // which is owned by CrosMountPointProvider (i.e. by the time Profile is | 184 // which is owned by CrosMountPointProvider (i.e. by the time Profile is |
183 // removed, the file manager is already gone). Hence it's safe to use this as | 185 // removed, the file manager is already gone). Hence it's safe to use this as |
184 // a raw pointer. | 186 // a raw pointer. |
185 GDataFileSystemInterface* file_system_; | 187 GDataFileSystemInterface* file_system_; |
| 188 |
| 189 // Profile associated with the file system proxy. |
| 190 Profile* profile_; // Not owned. |
186 }; | 191 }; |
187 | 192 |
188 } // namespace chromeos | 193 } // namespace chromeos |
189 | 194 |
190 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_PROXY_H_ | 195 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_PROXY_H_ |
OLD | NEW |