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 |
(...skipping 23 matching lines...) Expand all Loading... |
34 bool is_directory; | 34 bool is_directory; |
35 }; | 35 }; |
36 | 36 |
37 // Used to get files from the file system. | 37 // Used to get files from the file system. |
38 typedef base::Callback<void(GDataFileError error, | 38 typedef base::Callback<void(GDataFileError error, |
39 const FilePath& file_path, | 39 const FilePath& file_path, |
40 const std::string& mime_type, | 40 const std::string& mime_type, |
41 GDataFileType file_type)> GetFileCallback; | 41 GDataFileType file_type)> GetFileCallback; |
42 | 42 |
43 // Used to get entry info from the file system, with the gdata file path. | 43 // Used to get entry info from the file system, with the gdata file path. |
44 // If |error| is not PLATFORM_FILE_OK, |file_info| is set to NULL. | 44 // If |error| is not GDATA_FILE_OK, |file_info| is set to NULL. |
45 // | 45 // |
46 // |gdata_file_path| parameter is provided as GDataEntryProto does not contain | 46 // |gdata_file_path| parameter is provided as GDataEntryProto does not contain |
47 // the gdata file path (i.e. only contains the base name without parent | 47 // the gdata file path (i.e. only contains the base name without parent |
48 // directory names). | 48 // directory names). |
49 typedef base::Callback<void(GDataFileError error, | 49 typedef base::Callback<void(GDataFileError error, |
50 const FilePath& gdata_file_path, | 50 const FilePath& gdata_file_path, |
51 scoped_ptr<GDataEntryProto> file_proto)> | 51 scoped_ptr<GDataEntryProto> file_proto)> |
52 GetEntryInfoWithFilePathCallback; | 52 GetEntryInfoWithFilePathCallback; |
53 | 53 |
54 // Used to get entry info from the file system. | |
55 // If |error| is not PLATFORM_FILE_OK, |entry_info| is set to NULL. | |
56 typedef base::Callback<void(GDataFileError error, | |
57 scoped_ptr<GDataEntryProto> entry_proto)> | |
58 GetEntryInfoCallback; | |
59 | |
60 // Used to read a directory from the file system. | 54 // Used to read a directory from the file system. |
61 // If |error| is not PLATFORM_FILE_OK, |entries| is set to NULL. | 55 // Similar to ReadDirectoryCallback but this one provides |
| 56 // |hide_hosted_documents| |
| 57 // If |error| is not GDATA_FILE_OK, |entries| is set to NULL. |
62 // |entries| are contents, both files and directories, of the directory. | 58 // |entries| are contents, both files and directories, of the directory. |
63 typedef std::vector<GDataEntryProto> GDataEntryProtoVector; | |
64 typedef base::Callback<void(GDataFileError error, | 59 typedef base::Callback<void(GDataFileError error, |
65 bool hide_hosted_documents, | 60 bool hide_hosted_documents, |
66 scoped_ptr<GDataEntryProtoVector> entries)> | 61 scoped_ptr<GDataEntryProtoVector> entries)> |
67 ReadDirectoryCallback; | 62 ReadDirectoryWithSettingCallback; |
68 | 63 |
69 // Used to get drive content search results. | 64 // Used to get drive content search results. |
70 // If |error| is not PLATFORM_FILE_OK, |result_paths| is empty. | 65 // If |error| is not GDATA_FILE_OK, |result_paths| is empty. |
71 typedef base::Callback<void( | 66 typedef base::Callback<void( |
72 GDataFileError error, | 67 GDataFileError error, |
73 const GURL& next_feed, | 68 const GURL& next_feed, |
74 scoped_ptr<std::vector<SearchResultInfo> > result_paths)> SearchCallback; | 69 scoped_ptr<std::vector<SearchResultInfo> > result_paths)> SearchCallback; |
75 | 70 |
76 // Used to open files from the file system. |file_path| is the path on the local | 71 // Used to open files from the file system. |file_path| is the path on the local |
77 // file system for the opened file. | 72 // file system for the opened file. |
78 typedef base::Callback<void(GDataFileError error, | 73 typedef base::Callback<void(GDataFileError error, |
79 const FilePath& file_path)> OpenFileCallback; | 74 const FilePath& file_path)> OpenFileCallback; |
80 | 75 |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 // retrieve and refresh file system content from server and disk cache. | 296 // retrieve and refresh file system content from server and disk cache. |
302 // | 297 // |
303 // Can be called from UI/IO thread. |callback| is run on the calling thread. | 298 // Can be called from UI/IO thread. |callback| is run on the calling thread. |
304 virtual void GetEntryInfoByPath(const FilePath& file_path, | 299 virtual void GetEntryInfoByPath(const FilePath& file_path, |
305 const GetEntryInfoCallback& callback) = 0; | 300 const GetEntryInfoCallback& callback) = 0; |
306 | 301 |
307 // Finds and reads a directory by |file_path|. This call will also retrieve | 302 // Finds and reads a directory by |file_path|. This call will also retrieve |
308 // and refresh file system content from server and disk cache. | 303 // and refresh file system content from server and disk cache. |
309 // | 304 // |
310 // Can be called from UI/IO thread. |callback| is run on the calling thread. | 305 // Can be called from UI/IO thread. |callback| is run on the calling thread. |
311 virtual void ReadDirectoryByPath(const FilePath& file_path, | 306 virtual void ReadDirectoryByPath( |
312 const ReadDirectoryCallback& callback) = 0; | 307 const FilePath& file_path, |
| 308 const ReadDirectoryWithSettingCallback& callback) = 0; |
313 | 309 |
314 // Requests a refresh of the directory pointed by |file_path| (i.e. fetches | 310 // Requests a refresh of the directory pointed by |file_path| (i.e. fetches |
315 // the latest metadata of files in the target directory). | 311 // the latest metadata of files in the target directory). |
316 // | 312 // |
317 // In particular, this function is used to get the latest thumbnail | 313 // In particular, this function is used to get the latest thumbnail |
318 // URLs. Thumbnail URLs change periodically even if contents of files are | 314 // URLs. Thumbnail URLs change periodically even if contents of files are |
319 // not changed, hence we should get the new thumbnail URLs manually if we | 315 // not changed, hence we should get the new thumbnail URLs manually if we |
320 // detect that the existing thumbnail URLs are stale. | 316 // detect that the existing thumbnail URLs are stale. |
321 // | 317 // |
322 // Upon success, the metadata of files in the target directory is updated, | 318 // Upon success, the metadata of files in the target directory is updated, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 const FilePath& virtual_dir_path, | 351 const FilePath& virtual_dir_path, |
356 scoped_ptr<DocumentEntry> entry, | 352 scoped_ptr<DocumentEntry> entry, |
357 const FilePath& file_content_path, | 353 const FilePath& file_content_path, |
358 GDataCache::FileOperationType cache_operation, | 354 GDataCache::FileOperationType cache_operation, |
359 const base::Closure& callback) = 0; | 355 const base::Closure& callback) = 0; |
360 }; | 356 }; |
361 | 357 |
362 } // namespace gdata | 358 } // namespace gdata |
363 | 359 |
364 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_INTERFACE_H_ | 360 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_INTERFACE_H_ |
OLD | NEW |