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 "components/drive/service/fake_drive_service.h" | 5 #include "components/drive/service/fake_drive_service.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 std::string directory_resource_id; | 493 std::string directory_resource_id; |
494 int start_offset = 0; | 494 int start_offset = 0; |
495 int max_results = default_max_results_; | 495 int max_results = default_max_results_; |
496 base::StringPairs parameters; | 496 base::StringPairs parameters; |
497 if (base::SplitStringIntoKeyValuePairs( | 497 if (base::SplitStringIntoKeyValuePairs( |
498 next_link.query(), '=', '&', ¶meters)) { | 498 next_link.query(), '=', '&', ¶meters)) { |
499 for (size_t i = 0; i < parameters.size(); ++i) { | 499 for (size_t i = 0; i < parameters.size(); ++i) { |
500 if (parameters[i].first == "changestamp") { | 500 if (parameters[i].first == "changestamp") { |
501 base::StringToInt64(parameters[i].second, &start_changestamp); | 501 base::StringToInt64(parameters[i].second, &start_changestamp); |
502 } else if (parameters[i].first == "q") { | 502 } else if (parameters[i].first == "q") { |
503 search_query = | 503 search_query = net::UnescapeURLComponent( |
504 net::UnescapeURLComponent(parameters[i].second, | 504 parameters[i].second, |
505 net::UnescapeRule::URL_SPECIAL_CHARS); | 505 net::UnescapeRule::PATH_SEPARATORS | |
| 506 net::UnescapeRule::URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS); |
506 } else if (parameters[i].first == "parent") { | 507 } else if (parameters[i].first == "parent") { |
507 directory_resource_id = | 508 directory_resource_id = net::UnescapeURLComponent( |
508 net::UnescapeURLComponent(parameters[i].second, | 509 parameters[i].second, |
509 net::UnescapeRule::URL_SPECIAL_CHARS); | 510 net::UnescapeRule::PATH_SEPARATORS | |
| 511 net::UnescapeRule::URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS); |
510 } else if (parameters[i].first == "start-offset") { | 512 } else if (parameters[i].first == "start-offset") { |
511 base::StringToInt(parameters[i].second, &start_offset); | 513 base::StringToInt(parameters[i].second, &start_offset); |
512 } else if (parameters[i].first == "max-results") { | 514 } else if (parameters[i].first == "max-results") { |
513 base::StringToInt(parameters[i].second, &max_results); | 515 base::StringToInt(parameters[i].second, &max_results); |
514 } | 516 } |
515 } | 517 } |
516 } | 518 } |
517 | 519 |
518 GetChangeListInternal(start_changestamp, search_query, directory_resource_id, | 520 GetChangeListInternal(start_changestamp, search_query, directory_resource_id, |
519 start_offset, max_results, NULL, callback); | 521 start_offset, max_results, NULL, callback); |
(...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1814 | 1816 |
1815 NOTREACHED(); | 1817 NOTREACHED(); |
1816 return scoped_ptr<BatchRequestConfiguratorInterface>(); | 1818 return scoped_ptr<BatchRequestConfiguratorInterface>(); |
1817 } | 1819 } |
1818 | 1820 |
1819 void FakeDriveService::NotifyObservers() { | 1821 void FakeDriveService::NotifyObservers() { |
1820 FOR_EACH_OBSERVER(ChangeObserver, change_observers_, OnNewChangeAvailable()); | 1822 FOR_EACH_OBSERVER(ChangeObserver, change_observers_, OnNewChangeAvailable()); |
1821 } | 1823 } |
1822 | 1824 |
1823 } // namespace drive | 1825 } // namespace drive |
OLD | NEW |