Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: chrome/browser/drive/fake_drive_service.cc

Issue 599463002: Use base::StringPairs where appropriate from src/chrome/browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixing nit Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/identity/gaia_web_auth_flow.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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(), '=', '&', &parameters)) { 463 next_link.query(), '=', '&', &parameters)) {
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/identity/gaia_web_auth_flow.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698