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 17 matching lines...) Expand all Loading... |
28 SearchResultInfo(const FilePath& in_path, bool in_is_directory) | 28 SearchResultInfo(const FilePath& in_path, bool in_is_directory) |
29 : path(in_path), | 29 : path(in_path), |
30 is_directory(in_is_directory) { | 30 is_directory(in_is_directory) { |
31 } | 31 } |
32 | 32 |
33 FilePath path; | 33 FilePath path; |
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(DriveFileError error, |
39 const FilePath& file_path, | 39 const FilePath& file_path, |
40 const std::string& mime_type, | 40 const std::string& mime_type, |
41 DriveFileType file_type)> GetFileCallback; | 41 DriveFileType file_type)> GetFileCallback; |
42 | 42 |
43 // Used to read a directory from the file system. | 43 // Used to read a directory from the file system. |
44 // Similar to ReadDirectoryCallback but this one provides | 44 // Similar to ReadDirectoryCallback but this one provides |
45 // |hide_hosted_documents| | 45 // |hide_hosted_documents| |
46 // If |error| is not GDATA_FILE_OK, |entries| is set to NULL. | 46 // If |error| is not DRIVE_FILE_OK, |entries| is set to NULL. |
47 // |entries| are contents, both files and directories, of the directory. | 47 // |entries| are contents, both files and directories, of the directory. |
48 typedef base::Callback<void(GDataFileError error, | 48 typedef base::Callback<void(DriveFileError error, |
49 bool hide_hosted_documents, | 49 bool hide_hosted_documents, |
50 scoped_ptr<DriveEntryProtoVector> entries)> | 50 scoped_ptr<DriveEntryProtoVector> entries)> |
51 ReadDirectoryWithSettingCallback; | 51 ReadDirectoryWithSettingCallback; |
52 | 52 |
53 // Used to get drive content search results. | 53 // Used to get drive content search results. |
54 // If |error| is not GDATA_FILE_OK, |result_paths| is empty. | 54 // If |error| is not DRIVE_FILE_OK, |result_paths| is empty. |
55 typedef base::Callback<void( | 55 typedef base::Callback<void( |
56 GDataFileError error, | 56 DriveFileError error, |
57 const GURL& next_feed, | 57 const GURL& next_feed, |
58 scoped_ptr<std::vector<SearchResultInfo> > result_paths)> SearchCallback; | 58 scoped_ptr<std::vector<SearchResultInfo> > result_paths)> SearchCallback; |
59 | 59 |
60 // Used to open files from the file system. |file_path| is the path on the local | 60 // Used to open files from the file system. |file_path| is the path on the local |
61 // file system for the opened file. | 61 // file system for the opened file. |
62 typedef base::Callback<void(GDataFileError error, | 62 typedef base::Callback<void(DriveFileError error, |
63 const FilePath& file_path)> OpenFileCallback; | 63 const FilePath& file_path)> OpenFileCallback; |
64 | 64 |
65 // Used to get available space for the account from GData. | 65 // Used to get available space for the account from GData. |
66 typedef base::Callback<void(GDataFileError error, | 66 typedef base::Callback<void(DriveFileError error, |
67 int64 bytes_total, | 67 int64 bytes_total, |
68 int64 bytes_used)> GetAvailableSpaceCallback; | 68 int64 bytes_used)> GetAvailableSpaceCallback; |
69 | 69 |
70 // GData file system abstraction layer. | 70 // GData file system abstraction layer. |
71 // The interface is defined to make GDataFileSystem mockable. | 71 // The interface is defined to make GDataFileSystem mockable. |
72 class GDataFileSystemInterface { | 72 class GDataFileSystemInterface { |
73 public: | 73 public: |
74 virtual ~GDataFileSystemInterface() {} | 74 virtual ~GDataFileSystemInterface() {} |
75 | 75 |
76 // Used to notify events on the file system. | 76 // Used to notify events on the file system. |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 virtual void UpdateEntryData(const std::string& resource_id, | 359 virtual void UpdateEntryData(const std::string& resource_id, |
360 const std::string& md5, | 360 const std::string& md5, |
361 scoped_ptr<DocumentEntry> entry, | 361 scoped_ptr<DocumentEntry> entry, |
362 const FilePath& file_content_path, | 362 const FilePath& file_content_path, |
363 const base::Closure& callback) = 0; | 363 const base::Closure& callback) = 0; |
364 }; | 364 }; |
365 | 365 |
366 } // namespace gdata | 366 } // namespace gdata |
367 | 367 |
368 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_INTERFACE_H_ | 368 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_INTERFACE_H_ |
OLD | NEW |