| 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 virtual void GetUploadStatus( | 161 virtual void GetUploadStatus( |
| 162 UploadMode upload_mode, | 162 UploadMode upload_mode, |
| 163 const base::FilePath& drive_file_path, | 163 const base::FilePath& drive_file_path, |
| 164 const GURL& upload_url, | 164 const GURL& upload_url, |
| 165 int64 content_length, | 165 int64 content_length, |
| 166 const UploadRangeCallback& callback) OVERRIDE; | 166 const UploadRangeCallback& callback) OVERRIDE; |
| 167 virtual void AuthorizeApp(const std::string& resource_id, | 167 virtual void AuthorizeApp(const std::string& resource_id, |
| 168 const std::string& app_id, | 168 const std::string& app_id, |
| 169 const AuthorizeAppCallback& callback) OVERRIDE; | 169 const AuthorizeAppCallback& callback) OVERRIDE; |
| 170 | 170 |
| 171 // Adds a new file with the given parameters. On success, returns |
| 172 // HTTP_CREATED with the parsed entry. |
| 173 // |callback| must not be null. |
| 174 void AddNewFile(const std::string& content_type, |
| 175 int64 content_length, |
| 176 const std::string& parent_resource_id, |
| 177 const std::string& title, |
| 178 const GetResourceEntryCallback& callback); |
| 179 |
| 180 // Sets the last modified time for an entry specified by |resource_id|. |
| 181 // On success, returns HTTP_SUCCESS with the parsed entry. |
| 182 // |callback| must not be null. |
| 183 void SetLastModifiedTime(const std::string& resource_id, |
| 184 const base::Time& last_modified_time, |
| 185 const GetResourceEntryCallback& callback); |
| 171 private: | 186 private: |
| 172 // Returns a pointer to the entry that matches |resource_id|, or NULL if | 187 // Returns a pointer to the entry that matches |resource_id|, or NULL if |
| 173 // not found. | 188 // not found. |
| 174 base::DictionaryValue* FindEntryByResourceId(const std::string& resource_id); | 189 base::DictionaryValue* FindEntryByResourceId(const std::string& resource_id); |
| 175 | 190 |
| 176 // Returns a pointer to the entry that matches |content_url|, or NULL if | 191 // Returns a pointer to the entry that matches |content_url|, or NULL if |
| 177 // not found. | 192 // not found. |
| 178 base::DictionaryValue* FindEntryByContentUrl(const GURL& content_url); | 193 base::DictionaryValue* FindEntryByContentUrl(const GURL& content_url); |
| 179 | 194 |
| 180 // Returns a pointer to the entry that matches |upload_url|, or NULL if | 195 // Returns a pointer to the entry that matches |upload_url|, or NULL if |
| (...skipping 29 matching lines...) Expand all Loading... |
| 210 int about_resource_load_count_; | 225 int about_resource_load_count_; |
| 211 bool offline_; | 226 bool offline_; |
| 212 base::FilePath last_cancelled_file_; | 227 base::FilePath last_cancelled_file_; |
| 213 | 228 |
| 214 DISALLOW_COPY_AND_ASSIGN(FakeDriveService); | 229 DISALLOW_COPY_AND_ASSIGN(FakeDriveService); |
| 215 }; | 230 }; |
| 216 | 231 |
| 217 } // namespace google_apis | 232 } // namespace google_apis |
| 218 | 233 |
| 219 #endif // CHROME_BROWSER_GOOGLE_APIS_FAKE_DRIVE_SERVICE_H_ | 234 #endif // CHROME_BROWSER_GOOGLE_APIS_FAKE_DRIVE_SERVICE_H_ |
| OLD | NEW |