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_GOOGLE_APIS_FAKE_DRIVE_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_GOOGLE_APIS_FAKE_DRIVE_SERVICE_H_ |
6 #define CHROME_BROWSER_GOOGLE_APIS_FAKE_DRIVE_SERVICE_H_ | 6 #define CHROME_BROWSER_GOOGLE_APIS_FAKE_DRIVE_SERVICE_H_ |
7 | 7 |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/google_apis/drive_service_interface.h" | 10 #include "chrome/browser/google_apis/drive_service_interface.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 const std::string& app_id, | 181 const std::string& app_id, |
182 const AuthorizeAppCallback& callback) OVERRIDE; | 182 const AuthorizeAppCallback& callback) OVERRIDE; |
183 | 183 |
184 // Adds a new file with the given parameters. On success, returns | 184 // Adds a new file with the given parameters. On success, returns |
185 // HTTP_CREATED with the parsed entry. | 185 // HTTP_CREATED with the parsed entry. |
186 // |callback| must not be null. | 186 // |callback| must not be null. |
187 void AddNewFile(const std::string& content_type, | 187 void AddNewFile(const std::string& content_type, |
188 int64 content_length, | 188 int64 content_length, |
189 const std::string& parent_resource_id, | 189 const std::string& parent_resource_id, |
190 const std::string& title, | 190 const std::string& title, |
| 191 bool shared_with_me, |
191 const GetResourceEntryCallback& callback); | 192 const GetResourceEntryCallback& callback); |
192 | 193 |
193 // Sets the last modified time for an entry specified by |resource_id|. | 194 // Sets the last modified time for an entry specified by |resource_id|. |
194 // On success, returns HTTP_SUCCESS with the parsed entry. | 195 // On success, returns HTTP_SUCCESS with the parsed entry. |
195 // |callback| must not be null. | 196 // |callback| must not be null. |
196 void SetLastModifiedTime(const std::string& resource_id, | 197 void SetLastModifiedTime(const std::string& resource_id, |
197 const base::Time& last_modified_time, | 198 const base::Time& last_modified_time, |
198 const GetResourceEntryCallback& callback); | 199 const GetResourceEntryCallback& callback); |
199 private: | 200 private: |
200 // Returns a pointer to the entry that matches |resource_id|, or NULL if | 201 // Returns a pointer to the entry that matches |resource_id|, or NULL if |
(...skipping 17 matching lines...) Expand all Loading... |
218 void AddNewChangestamp(base::DictionaryValue* entry); | 219 void AddNewChangestamp(base::DictionaryValue* entry); |
219 | 220 |
220 // Adds a new entry based on the given parameters. |entry_kind| should be | 221 // Adds a new entry based on the given parameters. |entry_kind| should be |
221 // "file" or "folder". Returns a pointer to the newly added entry, or NULL | 222 // "file" or "folder". Returns a pointer to the newly added entry, or NULL |
222 // if failed. | 223 // if failed. |
223 const base::DictionaryValue* AddNewEntry( | 224 const base::DictionaryValue* AddNewEntry( |
224 const std::string& content_type, | 225 const std::string& content_type, |
225 int64 content_length, | 226 int64 content_length, |
226 const std::string& parent_resource_id, | 227 const std::string& parent_resource_id, |
227 const std::string& title, | 228 const std::string& title, |
| 229 bool shared_with_me, |
228 const std::string& entry_kind); | 230 const std::string& entry_kind); |
229 | 231 |
230 // Core implementation of GetResourceList. | 232 // Core implementation of GetResourceList. |
231 // This method returns the slice of the all matched entries, and its range | 233 // This method returns the slice of the all matched entries, and its range |
232 // is between |start_offset| (inclusive) and |start_offset| + |max_results| | 234 // is between |start_offset| (inclusive) and |start_offset| + |max_results| |
233 // (exclusive). | 235 // (exclusive). |
234 void GetResourceListInternal(int64 start_changestamp, | 236 void GetResourceListInternal(int64 start_changestamp, |
235 const std::string& search_query, | 237 const std::string& search_query, |
236 const std::string& directory_resource_id, | 238 const std::string& directory_resource_id, |
237 int start_offset, | 239 int start_offset, |
(...skipping 11 matching lines...) Expand all Loading... |
249 int about_resource_load_count_; | 251 int about_resource_load_count_; |
250 bool offline_; | 252 bool offline_; |
251 base::FilePath last_cancelled_file_; | 253 base::FilePath last_cancelled_file_; |
252 | 254 |
253 DISALLOW_COPY_AND_ASSIGN(FakeDriveService); | 255 DISALLOW_COPY_AND_ASSIGN(FakeDriveService); |
254 }; | 256 }; |
255 | 257 |
256 } // namespace google_apis | 258 } // namespace google_apis |
257 | 259 |
258 #endif // CHROME_BROWSER_GOOGLE_APIS_FAKE_DRIVE_SERVICE_H_ | 260 #endif // CHROME_BROWSER_GOOGLE_APIS_FAKE_DRIVE_SERVICE_H_ |
OLD | NEW |