OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/drive/dummy_drive_service.h" | |
6 | |
7 #include "base/bind.h" | |
8 | |
9 using google_apis::AboutResourceCallback; | |
10 using google_apis::AppListCallback; | |
11 using google_apis::AuthStatusCallback; | |
12 using google_apis::AuthorizeAppCallback; | |
13 using google_apis::CancelCallback; | |
14 using google_apis::ChangeListCallback; | |
15 using google_apis::DownloadActionCallback; | |
16 using google_apis::EntryActionCallback; | |
17 using google_apis::FileListCallback; | |
18 using google_apis::FileResourceCallback; | |
19 using google_apis::GetContentCallback; | |
20 using google_apis::GetShareUrlCallback; | |
21 using google_apis::InitiateUploadCallback; | |
22 using google_apis::ProgressCallback; | |
23 using google_apis::drive::UploadRangeCallback; | |
24 | |
25 namespace drive { | |
26 | |
27 DummyDriveService::DummyDriveService() {} | |
28 | |
29 DummyDriveService::~DummyDriveService() {} | |
30 | |
31 void DummyDriveService::Initialize(const std::string& account_id) {} | |
32 | |
33 void DummyDriveService::AddObserver(DriveServiceObserver* observer) {} | |
34 | |
35 void DummyDriveService::RemoveObserver(DriveServiceObserver* observer) {} | |
36 | |
37 bool DummyDriveService::CanSendRequest() const { return true; } | |
38 | |
39 bool DummyDriveService::HasAccessToken() const { return true; } | |
40 | |
41 void DummyDriveService::RequestAccessToken(const AuthStatusCallback& callback) { | |
42 callback.Run(google_apis::HTTP_NOT_MODIFIED, "fake_access_token"); | |
43 } | |
44 | |
45 bool DummyDriveService::HasRefreshToken() const { return true; } | |
46 | |
47 void DummyDriveService::ClearAccessToken() { } | |
48 | |
49 void DummyDriveService::ClearRefreshToken() { } | |
50 | |
51 std::string DummyDriveService::GetRootResourceId() const { | |
52 return "dummy_root"; | |
53 } | |
54 | |
55 CancelCallback DummyDriveService::GetAllFileList( | |
56 const FileListCallback& callback) { return CancelCallback(); } | |
57 | |
58 CancelCallback DummyDriveService::GetFileListInDirectory( | |
59 const std::string& directory_resource_id, | |
60 const FileListCallback& callback) { return CancelCallback(); } | |
61 | |
62 CancelCallback DummyDriveService::Search( | |
63 const std::string& search_query, | |
64 const FileListCallback& callback) { return CancelCallback(); } | |
65 | |
66 CancelCallback DummyDriveService::SearchByTitle( | |
67 const std::string& title, | |
68 const std::string& directory_resource_id, | |
69 const FileListCallback& callback) { return CancelCallback(); } | |
70 | |
71 CancelCallback DummyDriveService::GetChangeList( | |
72 int64 start_changestamp, | |
73 const ChangeListCallback& callback) { return CancelCallback(); } | |
74 | |
75 CancelCallback DummyDriveService::GetRemainingChangeList( | |
76 const GURL& next_link, | |
77 const ChangeListCallback& callback) { return CancelCallback(); } | |
78 | |
79 CancelCallback DummyDriveService::GetRemainingFileList( | |
80 const GURL& next_link, | |
81 const FileListCallback& callback) { return CancelCallback(); } | |
82 | |
83 CancelCallback DummyDriveService::GetFileResource( | |
84 const std::string& resource_id, | |
85 const FileResourceCallback& callback) { return CancelCallback(); } | |
86 | |
87 CancelCallback DummyDriveService::GetShareUrl( | |
88 const std::string& resource_id, | |
89 const GURL& embed_origin, | |
90 const GetShareUrlCallback& callback) { return CancelCallback(); } | |
91 | |
92 CancelCallback DummyDriveService::GetAboutResource( | |
93 const AboutResourceCallback& callback) { return CancelCallback(); } | |
94 | |
95 CancelCallback DummyDriveService::GetAppList( | |
96 const AppListCallback& callback) { return CancelCallback(); } | |
97 | |
98 CancelCallback DummyDriveService::DeleteResource( | |
99 const std::string& resource_id, | |
100 const std::string& etag, | |
101 const EntryActionCallback& callback) { return CancelCallback(); } | |
102 | |
103 CancelCallback DummyDriveService::TrashResource( | |
104 const std::string& resource_id, | |
105 const EntryActionCallback& callback) { return CancelCallback(); } | |
106 | |
107 CancelCallback DummyDriveService::DownloadFile( | |
108 const base::FilePath& local_cache_path, | |
109 const std::string& resource_id, | |
110 const DownloadActionCallback& download_action_callback, | |
111 const GetContentCallback& get_content_callback, | |
112 const ProgressCallback& progress_callback) { return CancelCallback(); } | |
113 | |
114 CancelCallback DummyDriveService::CopyResource( | |
115 const std::string& resource_id, | |
116 const std::string& parent_resource_id, | |
117 const std::string& new_title, | |
118 const base::Time& last_modified, | |
119 const FileResourceCallback& callback) { return CancelCallback(); } | |
120 | |
121 CancelCallback DummyDriveService::UpdateResource( | |
122 const std::string& resource_id, | |
123 const std::string& parent_resource_id, | |
124 const std::string& new_title, | |
125 const base::Time& last_modified, | |
126 const base::Time& last_viewed_by_me, | |
127 const google_apis::drive::Properties& properties, | |
128 const google_apis::FileResourceCallback& callback) { | |
129 return CancelCallback(); | |
130 } | |
131 | |
132 CancelCallback DummyDriveService::AddResourceToDirectory( | |
133 const std::string& parent_resource_id, | |
134 const std::string& resource_id, | |
135 const EntryActionCallback& callback) { return CancelCallback(); } | |
136 | |
137 CancelCallback DummyDriveService::RemoveResourceFromDirectory( | |
138 const std::string& parent_resource_id, | |
139 const std::string& resource_id, | |
140 const EntryActionCallback& callback) { return CancelCallback(); } | |
141 | |
142 CancelCallback DummyDriveService::AddNewDirectory( | |
143 const std::string& parent_resource_id, | |
144 const std::string& directory_title, | |
145 const AddNewDirectoryOptions& options, | |
146 const FileResourceCallback& callback) { return CancelCallback(); } | |
147 | |
148 CancelCallback DummyDriveService::InitiateUploadNewFile( | |
149 const std::string& content_type, | |
150 int64 content_length, | |
151 const std::string& parent_resource_id, | |
152 const std::string& title, | |
153 const UploadNewFileOptions& options, | |
154 const InitiateUploadCallback& callback) { | |
155 return CancelCallback(); | |
156 } | |
157 | |
158 CancelCallback DummyDriveService::InitiateUploadExistingFile( | |
159 const std::string& content_type, | |
160 int64 content_length, | |
161 const std::string& resource_id, | |
162 const UploadExistingFileOptions& options, | |
163 const InitiateUploadCallback& callback) { | |
164 return CancelCallback(); | |
165 } | |
166 | |
167 CancelCallback DummyDriveService::ResumeUpload( | |
168 const GURL& upload_url, | |
169 int64 start_position, | |
170 int64 end_position, | |
171 int64 content_length, | |
172 const std::string& content_type, | |
173 const base::FilePath& local_file_path, | |
174 const UploadRangeCallback& callback, | |
175 const ProgressCallback& progress_callback) { return CancelCallback(); } | |
176 | |
177 CancelCallback DummyDriveService::GetUploadStatus( | |
178 const GURL& upload_url, | |
179 int64 content_length, | |
180 const UploadRangeCallback& callback) { return CancelCallback(); } | |
181 | |
182 CancelCallback DummyDriveService::MultipartUploadNewFile( | |
183 const std::string& content_type, | |
184 int64 content_length, | |
185 const std::string& parent_resource_id, | |
186 const std::string& title, | |
187 const base::FilePath& local_file_path, | |
188 const UploadNewFileOptions& options, | |
189 const FileResourceCallback& callback, | |
190 const ProgressCallback& progress_callback) { | |
191 return CancelCallback(); | |
192 } | |
193 | |
194 CancelCallback DummyDriveService::MultipartUploadExistingFile( | |
195 const std::string& content_type, | |
196 int64 content_length, | |
197 const std::string& resource_id, | |
198 const base::FilePath& local_file_path, | |
199 const UploadExistingFileOptions& options, | |
200 const FileResourceCallback& callback, | |
201 const ProgressCallback& progress_callback) { | |
202 return CancelCallback(); | |
203 } | |
204 | |
205 CancelCallback DummyDriveService::AuthorizeApp( | |
206 const std::string& resource_id, | |
207 const std::string& app_id, | |
208 const AuthorizeAppCallback& callback) { return CancelCallback(); } | |
209 | |
210 CancelCallback DummyDriveService::UninstallApp( | |
211 const std::string& app_id, | |
212 const EntryActionCallback& callback) { return CancelCallback(); } | |
213 | |
214 CancelCallback DummyDriveService::AddPermission( | |
215 const std::string& resource_id, | |
216 const std::string& email, | |
217 google_apis::drive::PermissionRole role, | |
218 const EntryActionCallback& callback) { return CancelCallback(); } | |
219 scoped_ptr<BatchRequestConfiguratorInterface> | |
220 DummyDriveService::StartBatchRequest() { | |
221 return scoped_ptr<BatchRequestConfiguratorInterface>(); | |
222 } | |
223 | |
224 } // namespace drive | |
OLD | NEW |