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

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

Issue 16063009: Unescape resource id and search query contained in feed url in FakeDriveService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix search_query Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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/google_apis/fake_drive_service.h" 5 #include "chrome/browser/google_apis/fake_drive_service.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 std::string directory_resource_id; 339 std::string directory_resource_id;
340 int start_offset = 0; 340 int start_offset = 0;
341 int max_results = default_max_results_; 341 int max_results = default_max_results_;
342 std::vector<std::pair<std::string, std::string> > parameters; 342 std::vector<std::pair<std::string, std::string> > parameters;
343 if (base::SplitStringIntoKeyValuePairs( 343 if (base::SplitStringIntoKeyValuePairs(
344 override_url.query(), '=', '&', &parameters)) { 344 override_url.query(), '=', '&', &parameters)) {
345 for (size_t i = 0; i < parameters.size(); ++i) { 345 for (size_t i = 0; i < parameters.size(); ++i) {
346 if (parameters[i].first == "changestamp") { 346 if (parameters[i].first == "changestamp") {
347 base::StringToInt64(parameters[i].second, &start_changestamp); 347 base::StringToInt64(parameters[i].second, &start_changestamp);
348 } else if (parameters[i].first == "q") { 348 } else if (parameters[i].first == "q") {
349 search_query = parameters[i].second; 349 search_query =
350 net::UnescapeURLComponent(parameters[i].second,
351 net::UnescapeRule::URL_SPECIAL_CHARS);
350 } else if (parameters[i].first == "parent") { 352 } else if (parameters[i].first == "parent") {
351 directory_resource_id = parameters[i].second; 353 directory_resource_id =
354 net::UnescapeURLComponent(parameters[i].second,
355 net::UnescapeRule::URL_SPECIAL_CHARS);
352 } else if (parameters[i].first == "start-offset") { 356 } else if (parameters[i].first == "start-offset") {
353 base::StringToInt(parameters[i].second, &start_offset); 357 base::StringToInt(parameters[i].second, &start_offset);
354 } else if (parameters[i].first == "max-results") { 358 } else if (parameters[i].first == "max-results") {
355 base::StringToInt(parameters[i].second, &max_results); 359 base::StringToInt(parameters[i].second, &max_results);
356 } 360 }
357 } 361 }
358 } 362 }
359 363
360 GetResourceListInternal( 364 GetResourceListInternal(
361 start_changestamp, search_query, directory_resource_id, 365 start_changestamp, search_query, directory_resource_id,
(...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after
1430 if (load_counter) 1434 if (load_counter)
1431 *load_counter += 1; 1435 *load_counter += 1;
1432 base::MessageLoop::current()->PostTask( 1436 base::MessageLoop::current()->PostTask(
1433 FROM_HERE, 1437 FROM_HERE,
1434 base::Bind(callback, 1438 base::Bind(callback,
1435 HTTP_SUCCESS, 1439 HTTP_SUCCESS,
1436 base::Passed(&resource_list))); 1440 base::Passed(&resource_list)));
1437 } 1441 }
1438 1442
1439 } // namespace google_apis 1443 } // namespace google_apis
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698