| 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 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1273 error = google_apis::GDATA_NO_CONNECTION; | 1273 error = google_apis::GDATA_NO_CONNECTION; |
| 1274 } else { | 1274 } else { |
| 1275 base::ListValue* items = NULL; | 1275 base::ListValue* items = NULL; |
| 1276 if (app_info_value_->GetList("items", &items)) { | 1276 if (app_info_value_->GetList("items", &items)) { |
| 1277 for (size_t i = 0; i < items->GetSize(); ++i) { | 1277 for (size_t i = 0; i < items->GetSize(); ++i) { |
| 1278 base::DictionaryValue* item = NULL; | 1278 base::DictionaryValue* item = NULL; |
| 1279 std::string id; | 1279 std::string id; |
| 1280 if (items->GetDictionary(i, &item) && item->GetString("id", &id) && | 1280 if (items->GetDictionary(i, &item) && item->GetString("id", &id) && |
| 1281 id == app_id) { | 1281 id == app_id) { |
| 1282 if (items->Remove(i, NULL)) | 1282 if (items->Remove(i, NULL)) |
| 1283 error = google_apis::HTTP_SUCCESS; | 1283 error = google_apis::HTTP_NO_CONTENT; |
| 1284 break; | 1284 break; |
| 1285 } | 1285 } |
| 1286 } | 1286 } |
| 1287 } | 1287 } |
| 1288 } | 1288 } |
| 1289 | 1289 |
| 1290 base::MessageLoop::current()->PostTask(FROM_HERE, | 1290 base::MessageLoop::current()->PostTask(FROM_HERE, |
| 1291 base::Bind(callback, error)); | 1291 base::Bind(callback, error)); |
| 1292 return CancelCallback(); | 1292 return CancelCallback(); |
| 1293 } | 1293 } |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1732 FROM_HERE, | 1732 FROM_HERE, |
| 1733 base::Bind(callback, HTTP_SUCCESS, base::Passed(&resource_list))); | 1733 base::Bind(callback, HTTP_SUCCESS, base::Passed(&resource_list))); |
| 1734 } | 1734 } |
| 1735 | 1735 |
| 1736 GURL FakeDriveService::GetNewUploadSessionUrl() { | 1736 GURL FakeDriveService::GetNewUploadSessionUrl() { |
| 1737 return GURL("https://upload_session_url/" + | 1737 return GURL("https://upload_session_url/" + |
| 1738 base::Int64ToString(next_upload_sequence_number_++)); | 1738 base::Int64ToString(next_upload_sequence_number_++)); |
| 1739 } | 1739 } |
| 1740 | 1740 |
| 1741 } // namespace drive | 1741 } // namespace drive |
| OLD | NEW |