| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 // TODO(peria): Deal with other attributes than title. | 98 // TODO(peria): Deal with other attributes than title. |
| 99 if (!key.empty() && key != "title") | 99 if (!key.empty() && key != "title") |
| 100 return false; | 100 return false; |
| 101 // Search query in the title. | 101 // Search query in the title. |
| 102 if (entry.title().find(value) == std::string::npos) | 102 if (entry.title().find(value) == std::string::npos) |
| 103 return false; | 103 return false; |
| 104 } | 104 } |
| 105 return true; | 105 return true; |
| 106 } | 106 } |
| 107 | 107 |
| 108 // Returns |url| without query parameter. | |
| 109 GURL RemoveQueryParameter(const GURL& url) { | |
| 110 GURL::Replacements replacements; | |
| 111 replacements.ClearQuery(); | |
| 112 return url.ReplaceComponents(replacements); | |
| 113 } | |
| 114 | |
| 115 void ScheduleUploadRangeCallback(const UploadRangeCallback& callback, | 108 void ScheduleUploadRangeCallback(const UploadRangeCallback& callback, |
| 116 int64 start_position, | 109 int64 start_position, |
| 117 int64 end_position, | 110 int64 end_position, |
| 118 GDataErrorCode error, | 111 GDataErrorCode error, |
| 119 scoped_ptr<ResourceEntry> entry) { | 112 scoped_ptr<ResourceEntry> entry) { |
| 120 base::MessageLoop::current()->PostTask( | 113 base::MessageLoop::current()->PostTask( |
| 121 FROM_HERE, | 114 FROM_HERE, |
| 122 base::Bind(callback, | 115 base::Bind(callback, |
| 123 UploadRangeResponse(error, | 116 UploadRangeResponse(error, |
| 124 start_position, | 117 start_position, |
| (...skipping 1550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1675 FROM_HERE, | 1668 FROM_HERE, |
| 1676 base::Bind(callback, HTTP_SUCCESS, base::Passed(&resource_list))); | 1669 base::Bind(callback, HTTP_SUCCESS, base::Passed(&resource_list))); |
| 1677 } | 1670 } |
| 1678 | 1671 |
| 1679 GURL FakeDriveService::GetNewUploadSessionUrl() { | 1672 GURL FakeDriveService::GetNewUploadSessionUrl() { |
| 1680 return GURL("https://upload_session_url/" + | 1673 return GURL("https://upload_session_url/" + |
| 1681 base::Int64ToString(next_upload_sequence_number_++)); | 1674 base::Int64ToString(next_upload_sequence_number_++)); |
| 1682 } | 1675 } |
| 1683 | 1676 |
| 1684 } // namespace drive | 1677 } // namespace drive |
| OLD | NEW |