| 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_INTERFACE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_INTERFACE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_INTERFACE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_INTERFACE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "chrome/browser/chromeos/gdata/gdata_cache.h" | 12 #include "chrome/browser/chromeos/gdata/gdata_cache.h" |
| 13 #include "chrome/browser/chromeos/gdata/gdata_files.h" | 13 #include "chrome/browser/chromeos/gdata/gdata_files.h" |
| 14 #include "chrome/browser/chromeos/gdata/gdata_params.h" | 14 #include "chrome/browser/chromeos/gdata/gdata_operations.h" |
| 15 #include "chrome/browser/chromeos/gdata/gdata_upload_file_info.h" | 15 #include "chrome/browser/chromeos/gdata/gdata_upload_file_info.h" |
| 16 | 16 |
| 17 namespace gdata { | 17 namespace gdata { |
| 18 | 18 |
| 19 class DocumentEntry; | 19 class DocumentEntry; |
| 20 class GDataDirectoryProto; | 20 class GDataDirectoryProto; |
| 21 class GDataEntryProto; | 21 class GDataEntryProto; |
| 22 class GDataFileProto; | 22 class GDataFileProto; |
| 23 | 23 |
| 24 // Information about search result returned by Search Async callback. | 24 // Information about search result returned by Search Async callback. |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 virtual void CreateFile(const FilePath& file_path, | 256 virtual void CreateFile(const FilePath& file_path, |
| 257 bool is_exclusive, | 257 bool is_exclusive, |
| 258 const FileOperationCallback& callback) = 0; | 258 const FileOperationCallback& callback) = 0; |
| 259 | 259 |
| 260 // Gets |file_path| from the file system. The file entry represented by | 260 // Gets |file_path| from the file system. The file entry represented by |
| 261 // |file_path| needs to be present in in-memory representation of the file | 261 // |file_path| needs to be present in in-memory representation of the file |
| 262 // system in order to be retrieved. If the file is not cached, the file | 262 // system in order to be retrieved. If the file is not cached, the file |
| 263 // will be downloaded through gdata api. | 263 // will be downloaded through gdata api. |
| 264 // | 264 // |
| 265 // Can be called from UI/IO thread. |get_file_callback| and | 265 // Can be called from UI/IO thread. |get_file_callback| and |
| 266 // |get_download_data| are run on the calling thread. | 266 // |get_content_callback| are run on the calling thread. |
| 267 virtual void GetFileByPath( | 267 virtual void GetFileByPath( |
| 268 const FilePath& file_path, | 268 const FilePath& file_path, |
| 269 const GetFileCallback& get_file_callback, | 269 const GetFileCallback& get_file_callback, |
| 270 const GetDownloadDataCallback& get_download_data_callback) = 0; | 270 const GetContentCallback& get_content_callback) = 0; |
| 271 | 271 |
| 272 // Gets a file by the given |resource_id| from the gdata server. Used for | 272 // Gets a file by the given |resource_id| from the gdata server. Used for |
| 273 // fetching pinned-but-not-fetched files. | 273 // fetching pinned-but-not-fetched files. |
| 274 // | 274 // |
| 275 // Can be called from UI/IO thread. |get_file_callback| and | 275 // Can be called from UI/IO thread. |get_file_callback| and |
| 276 // |get_download_data_callback| are run on the calling thread. | 276 // |get_content_callback| are run on the calling thread. |
| 277 virtual void GetFileByResourceId( | 277 virtual void GetFileByResourceId( |
| 278 const std::string& resource_id, | 278 const std::string& resource_id, |
| 279 const GetFileCallback& get_file_callback, | 279 const GetFileCallback& get_file_callback, |
| 280 const GetDownloadDataCallback& get_download_data_callback) = 0; | 280 const GetContentCallback& get_content_callback) = 0; |
| 281 | 281 |
| 282 // Updates a file by the given |resource_id| on the gdata server by | 282 // Updates a file by the given |resource_id| on the gdata server by |
| 283 // uploading an updated version. Used for uploading dirty files. The file | 283 // uploading an updated version. Used for uploading dirty files. The file |
| 284 // should already be present in the cache. | 284 // should already be present in the cache. |
| 285 // | 285 // |
| 286 // TODO(satorux): As of now, the function only handles files with the dirty | 286 // TODO(satorux): As of now, the function only handles files with the dirty |
| 287 // bit committed. We should eliminate the restriction. crbug.com/134558. | 287 // bit committed. We should eliminate the restriction. crbug.com/134558. |
| 288 // | 288 // |
| 289 // Can be called from UI/IO thread. |callback| and is run on the calling | 289 // Can be called from UI/IO thread. |callback| and is run on the calling |
| 290 // thread. | 290 // thread. |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 const FilePath& virtual_dir_path, | 351 const FilePath& virtual_dir_path, |
| 352 scoped_ptr<DocumentEntry> entry, | 352 scoped_ptr<DocumentEntry> entry, |
| 353 const FilePath& file_content_path, | 353 const FilePath& file_content_path, |
| 354 GDataCache::FileOperationType cache_operation, | 354 GDataCache::FileOperationType cache_operation, |
| 355 const base::Closure& callback) = 0; | 355 const base::Closure& callback) = 0; |
| 356 }; | 356 }; |
| 357 | 357 |
| 358 } // namespace gdata | 358 } // namespace gdata |
| 359 | 359 |
| 360 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_INTERFACE_H_ | 360 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_INTERFACE_H_ |
| OLD | NEW |