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 #include "chrome/browser/google_apis/fake_drive_service.h" | 5 #include "chrome/browser/google_apis/fake_drive_service.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 base::Bind(callback, | 333 base::Bind(callback, |
334 HTTP_SUCCESS, | 334 HTTP_SUCCESS, |
335 base::Passed(&resource_list))); | 335 base::Passed(&resource_list))); |
336 } | 336 } |
337 | 337 |
338 void FakeDriveService::GetAllResourceList( | 338 void FakeDriveService::GetAllResourceList( |
339 const GetResourceListCallback& callback) { | 339 const GetResourceListCallback& callback) { |
340 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 340 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
341 DCHECK(!callback.is_null()); | 341 DCHECK(!callback.is_null()); |
342 | 342 |
343 // TODO(hidehiko): Implement this. | 343 GetResourceList(GURL(), // no next feed |
344 NOTIMPLEMENTED(); | 344 0, // start changestamp |
| 345 "", // empty search query |
| 346 "", // no directory resource id, |
| 347 callback); |
345 } | 348 } |
346 | 349 |
347 void FakeDriveService::GetResourceListInDirectory( | 350 void FakeDriveService::GetResourceListInDirectory( |
348 const std::string& directory_resource_id, | 351 const std::string& directory_resource_id, |
349 const GetResourceListCallback& callback) { | 352 const GetResourceListCallback& callback) { |
350 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 353 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
351 DCHECK(!directory_resource_id.empty()); | 354 DCHECK(!directory_resource_id.empty()); |
352 DCHECK(!callback.is_null()); | 355 DCHECK(!callback.is_null()); |
353 | 356 |
354 // TODO(hidehiko): Implement this. | 357 GetResourceList(GURL(), // no next feed |
355 NOTIMPLEMENTED(); | 358 0, // start changestamp |
| 359 "", // empty search query |
| 360 directory_resource_id, |
| 361 callback); |
356 } | 362 } |
357 | 363 |
358 void FakeDriveService::Search(const std::string& search_query, | 364 void FakeDriveService::Search(const std::string& search_query, |
359 const GetResourceListCallback& callback) { | 365 const GetResourceListCallback& callback) { |
360 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 366 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
361 DCHECK(!search_query.empty()); | 367 DCHECK(!search_query.empty()); |
362 DCHECK(!callback.is_null()); | 368 DCHECK(!callback.is_null()); |
363 | 369 |
364 // TODO(hidehiko): Implement this. | 370 GetResourceList(GURL(), // no next feed |
365 NOTIMPLEMENTED(); | 371 0, // start changestamp |
| 372 search_query, |
| 373 "", // no directory resource id, |
| 374 callback); |
366 } | 375 } |
367 | 376 |
368 void FakeDriveService::SearchInDirectory( | 377 void FakeDriveService::SearchInDirectory( |
369 const std::string& search_query, | 378 const std::string& search_query, |
370 const std::string& directory_resource_id, | 379 const std::string& directory_resource_id, |
371 const GetResourceListCallback& callback) { | 380 const GetResourceListCallback& callback) { |
372 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 381 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
373 DCHECK(!search_query.empty()); | 382 DCHECK(!search_query.empty()); |
374 DCHECK(!directory_resource_id.empty()); | 383 DCHECK(!directory_resource_id.empty()); |
375 DCHECK(!callback.is_null()); | 384 DCHECK(!callback.is_null()); |
376 | 385 |
377 // TODO(hidehiko): Implement this. | 386 GetResourceList(GURL(), // no next feed |
378 NOTIMPLEMENTED(); | 387 0, // start changestamp |
| 388 search_query, |
| 389 directory_resource_id, |
| 390 callback); |
379 } | 391 } |
380 | 392 |
381 void FakeDriveService::GetChangeList(int64 start_changestamp, | 393 void FakeDriveService::GetChangeList(int64 start_changestamp, |
382 const GetResourceListCallback& callback) { | 394 const GetResourceListCallback& callback) { |
383 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 395 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
384 DCHECK(!callback.is_null()); | 396 DCHECK(!callback.is_null()); |
385 | 397 |
386 // TODO(hidehiko): Implement this. | 398 GetResourceList(GURL(), // no next feed |
387 NOTIMPLEMENTED(); | 399 start_changestamp, |
| 400 "", // empty search query |
| 401 "", // no directory resource id, |
| 402 callback); |
388 } | 403 } |
389 | 404 |
390 void FakeDriveService::ContinueGetResourceList( | 405 void FakeDriveService::ContinueGetResourceList( |
391 const GURL& override_url, | 406 const GURL& override_url, |
392 const GetResourceListCallback& callback) { | 407 const GetResourceListCallback& callback) { |
393 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 408 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
394 DCHECK(!callback.is_null()); | 409 DCHECK(!callback.is_null()); |
395 | 410 |
396 // TODO(hidehiko): Implement this. | 411 // TODO(hidehiko): Implement this. |
397 NOTIMPLEMENTED(); | 412 NOTIMPLEMENTED(); |
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1225 | 1240 |
1226 base::DictionaryValue* raw_new_entry = new_entry.release(); | 1241 base::DictionaryValue* raw_new_entry = new_entry.release(); |
1227 base::ListValue* entries = NULL; | 1242 base::ListValue* entries = NULL; |
1228 if (resource_list_dict->GetList("entry", &entries)) | 1243 if (resource_list_dict->GetList("entry", &entries)) |
1229 entries->Append(raw_new_entry); | 1244 entries->Append(raw_new_entry); |
1230 | 1245 |
1231 return raw_new_entry; | 1246 return raw_new_entry; |
1232 } | 1247 } |
1233 | 1248 |
1234 } // namespace google_apis | 1249 } // namespace google_apis |
OLD | NEW |