| 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/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/json/json_string_value_serializer.h" | 10 #include "base/json/json_string_value_serializer.h" |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 // previous method invocation, so it should start with "http://localhost/?". | 451 // previous method invocation, so it should start with "http://localhost/?". |
| 452 // See also GetChangeListInternal. | 452 // See also GetChangeListInternal. |
| 453 DCHECK_EQ(next_link.host(), "localhost"); | 453 DCHECK_EQ(next_link.host(), "localhost"); |
| 454 DCHECK_EQ(next_link.path(), "/"); | 454 DCHECK_EQ(next_link.path(), "/"); |
| 455 | 455 |
| 456 int64 start_changestamp = 0; | 456 int64 start_changestamp = 0; |
| 457 std::string search_query; | 457 std::string search_query; |
| 458 std::string directory_resource_id; | 458 std::string directory_resource_id; |
| 459 int start_offset = 0; | 459 int start_offset = 0; |
| 460 int max_results = default_max_results_; | 460 int max_results = default_max_results_; |
| 461 std::vector<std::pair<std::string, std::string> > parameters; | 461 base::StringPairs parameters; |
| 462 if (base::SplitStringIntoKeyValuePairs( | 462 if (base::SplitStringIntoKeyValuePairs( |
| 463 next_link.query(), '=', '&', ¶meters)) { | 463 next_link.query(), '=', '&', ¶meters)) { |
| 464 for (size_t i = 0; i < parameters.size(); ++i) { | 464 for (size_t i = 0; i < parameters.size(); ++i) { |
| 465 if (parameters[i].first == "changestamp") { | 465 if (parameters[i].first == "changestamp") { |
| 466 base::StringToInt64(parameters[i].second, &start_changestamp); | 466 base::StringToInt64(parameters[i].second, &start_changestamp); |
| 467 } else if (parameters[i].first == "q") { | 467 } else if (parameters[i].first == "q") { |
| 468 search_query = | 468 search_query = |
| 469 net::UnescapeURLComponent(parameters[i].second, | 469 net::UnescapeURLComponent(parameters[i].second, |
| 470 net::UnescapeRule::URL_SPECIAL_CHARS); | 470 net::UnescapeRule::URL_SPECIAL_CHARS); |
| 471 } else if (parameters[i].first == "parent") { | 471 } else if (parameters[i].first == "parent") { |
| (...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1688 | 1688 |
| 1689 NOTREACHED(); | 1689 NOTREACHED(); |
| 1690 return CancelCallback(); | 1690 return CancelCallback(); |
| 1691 } | 1691 } |
| 1692 | 1692 |
| 1693 void FakeDriveService::NotifyObservers() { | 1693 void FakeDriveService::NotifyObservers() { |
| 1694 FOR_EACH_OBSERVER(ChangeObserver, change_observers_, OnNewChangeAvailable()); | 1694 FOR_EACH_OBSERVER(ChangeObserver, change_observers_, OnNewChangeAvailable()); |
| 1695 } | 1695 } |
| 1696 | 1696 |
| 1697 } // namespace drive | 1697 } // namespace drive |
| OLD | NEW |