| 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/drive/fake_drive_service.h" | 5 #include "chrome/browser/drive/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 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1443 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1443 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 1444 | 1444 |
| 1445 base::ListValue* entries = NULL; | 1445 base::ListValue* entries = NULL; |
| 1446 // Go through entries and return the one that matches |resource_id|. | 1446 // Go through entries and return the one that matches |resource_id|. |
| 1447 if (resource_list_value_->GetList("entry", &entries)) { | 1447 if (resource_list_value_->GetList("entry", &entries)) { |
| 1448 for (size_t i = 0; i < entries->GetSize(); ++i) { | 1448 for (size_t i = 0; i < entries->GetSize(); ++i) { |
| 1449 base::DictionaryValue* entry = NULL; | 1449 base::DictionaryValue* entry = NULL; |
| 1450 std::string current_resource_id; | 1450 std::string current_resource_id; |
| 1451 if (entries->GetDictionary(i, &entry) && | 1451 if (entries->GetDictionary(i, &entry) && |
| 1452 entry->GetString("gd$resourceId.$t", ¤t_resource_id) && | 1452 entry->GetString("gd$resourceId.$t", ¤t_resource_id) && |
| 1453 resource_id == current_resource_id) { | 1453 resource_id == current_resource_id && |
| 1454 !entry->HasKey("docs$removed")) { |
| 1454 return entry; | 1455 return entry; |
| 1455 } | 1456 } |
| 1456 } | 1457 } |
| 1457 } | 1458 } |
| 1458 | 1459 |
| 1459 return NULL; | 1460 return NULL; |
| 1460 } | 1461 } |
| 1461 | 1462 |
| 1462 base::DictionaryValue* FakeDriveService::FindEntryByContentUrl( | 1463 base::DictionaryValue* FakeDriveService::FindEntryByContentUrl( |
| 1463 const GURL& content_url) { | 1464 const GURL& content_url) { |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1732 FROM_HERE, | 1733 FROM_HERE, |
| 1733 base::Bind(callback, HTTP_SUCCESS, base::Passed(&resource_list))); | 1734 base::Bind(callback, HTTP_SUCCESS, base::Passed(&resource_list))); |
| 1734 } | 1735 } |
| 1735 | 1736 |
| 1736 GURL FakeDriveService::GetNewUploadSessionUrl() { | 1737 GURL FakeDriveService::GetNewUploadSessionUrl() { |
| 1737 return GURL("https://upload_session_url/" + | 1738 return GURL("https://upload_session_url/" + |
| 1738 base::Int64ToString(next_upload_sequence_number_++)); | 1739 base::Int64ToString(next_upload_sequence_number_++)); |
| 1739 } | 1740 } |
| 1740 | 1741 |
| 1741 } // namespace drive | 1742 } // namespace drive |
| OLD | NEW |