OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SYNC_FILE_SYSTEM_DRIVE_BACKEND_FAKE_DRIVE_SERVICE_HELPER_
H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_FAKE_DRIVE_SERVICE_HELPER_
H_ |
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_FAKE_DRIVE_SERVICE_HELPER_
H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_FAKE_DRIVE_SERVICE_HELPER_
H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 google_apis::DriveApiErrorCode AddResourceToDirectory( | 53 google_apis::DriveApiErrorCode AddResourceToDirectory( |
54 const std::string& parent_folder_id, | 54 const std::string& parent_folder_id, |
55 const std::string& file_id); | 55 const std::string& file_id); |
56 google_apis::DriveApiErrorCode RemoveResourceFromDirectory( | 56 google_apis::DriveApiErrorCode RemoveResourceFromDirectory( |
57 const std::string& parent_folder_id, | 57 const std::string& parent_folder_id, |
58 const std::string& file_id); | 58 const std::string& file_id); |
59 google_apis::DriveApiErrorCode GetSyncRootFolderID( | 59 google_apis::DriveApiErrorCode GetSyncRootFolderID( |
60 std::string* sync_root_folder_id); | 60 std::string* sync_root_folder_id); |
61 google_apis::DriveApiErrorCode ListFilesInFolder( | 61 google_apis::DriveApiErrorCode ListFilesInFolder( |
62 const std::string& folder_id, | 62 const std::string& folder_id, |
63 ScopedVector<google_apis::FileResource>* entries); | 63 std::vector<std::unique_ptr<google_apis::FileResource>>* entries); |
64 google_apis::DriveApiErrorCode SearchByTitle( | 64 google_apis::DriveApiErrorCode SearchByTitle( |
65 const std::string& folder_id, | 65 const std::string& folder_id, |
66 const std::string& title, | 66 const std::string& title, |
67 ScopedVector<google_apis::FileResource>* entries); | 67 std::vector<std::unique_ptr<google_apis::FileResource>>* entries); |
68 | 68 |
69 google_apis::DriveApiErrorCode GetFileResource( | 69 google_apis::DriveApiErrorCode GetFileResource( |
70 const std::string& file_id, | 70 const std::string& file_id, |
71 std::unique_ptr<google_apis::FileResource>* entry); | 71 std::unique_ptr<google_apis::FileResource>* entry); |
72 google_apis::DriveApiErrorCode GetFileVisibility( | 72 google_apis::DriveApiErrorCode GetFileVisibility( |
73 const std::string& file_id, | 73 const std::string& file_id, |
74 google_apis::drive::FileVisibility* visiblity); | 74 google_apis::drive::FileVisibility* visiblity); |
75 google_apis::DriveApiErrorCode ReadFile( | 75 google_apis::DriveApiErrorCode ReadFile( |
76 const std::string& file_id, | 76 const std::string& file_id, |
77 std::string* file_content); | 77 std::string* file_content); |
78 google_apis::DriveApiErrorCode GetAboutResource( | 78 google_apis::DriveApiErrorCode GetAboutResource( |
79 std::unique_ptr<google_apis::AboutResource>* about_resource); | 79 std::unique_ptr<google_apis::AboutResource>* about_resource); |
80 | 80 |
81 base::FilePath base_dir_path() { return base_dir_.GetPath(); } | 81 base::FilePath base_dir_path() { return base_dir_.GetPath(); } |
82 | 82 |
83 private: | 83 private: |
84 google_apis::DriveApiErrorCode CompleteListing( | 84 google_apis::DriveApiErrorCode CompleteListing( |
85 std::unique_ptr<google_apis::FileList> list, | 85 std::unique_ptr<google_apis::FileList> list, |
86 ScopedVector<google_apis::FileResource>* entries); | 86 std::vector<std::unique_ptr<google_apis::FileResource>>* entries); |
87 | 87 |
88 void Initialize(); | 88 void Initialize(); |
89 | 89 |
90 base::FilePath WriteToTempFile(const std::string& content); | 90 base::FilePath WriteToTempFile(const std::string& content); |
91 | 91 |
92 base::ScopedTempDir base_dir_; | 92 base::ScopedTempDir base_dir_; |
93 base::FilePath temp_dir_; | 93 base::FilePath temp_dir_; |
94 | 94 |
95 // Not own. | 95 // Not own. |
96 drive::FakeDriveService* fake_drive_service_; | 96 drive::FakeDriveService* fake_drive_service_; |
97 drive::DriveUploaderInterface* drive_uploader_; | 97 drive::DriveUploaderInterface* drive_uploader_; |
98 | 98 |
99 std::string sync_root_folder_title_; | 99 std::string sync_root_folder_title_; |
100 }; | 100 }; |
101 | 101 |
102 } // namespace drive_backend | 102 } // namespace drive_backend |
103 } // namespace sync_file_system | 103 } // namespace sync_file_system |
104 | 104 |
105 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_FAKE_DRIVE_SERVICE_HELP
ER_H_ | 105 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_FAKE_DRIVE_SERVICE_HELP
ER_H_ |
OLD | NEW |