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/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 Loading... | |
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(), '=', '&', ¶meters)) { | 344 override_url.query(), '=', '&', ¶meters)) { |
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 = parameters[i].second; |
kinaba
2013/06/04 06:46:52
Do we also need unescaping here as well?
If so, co
nhiroki
2013/06/04 07:05:52
That's right. Done.
| |
350 } else if (parameters[i].first == "parent") { | 350 } else if (parameters[i].first == "parent") { |
351 directory_resource_id = parameters[i].second; | 351 directory_resource_id = |
352 net::UnescapeURLComponent(parameters[i].second, | |
353 net::UnescapeRule::URL_SPECIAL_CHARS); | |
352 } else if (parameters[i].first == "start-offset") { | 354 } else if (parameters[i].first == "start-offset") { |
353 base::StringToInt(parameters[i].second, &start_offset); | 355 base::StringToInt(parameters[i].second, &start_offset); |
354 } else if (parameters[i].first == "max-results") { | 356 } else if (parameters[i].first == "max-results") { |
355 base::StringToInt(parameters[i].second, &max_results); | 357 base::StringToInt(parameters[i].second, &max_results); |
356 } | 358 } |
357 } | 359 } |
358 } | 360 } |
359 | 361 |
360 GetResourceListInternal( | 362 GetResourceListInternal( |
361 start_changestamp, search_query, directory_resource_id, | 363 start_changestamp, search_query, directory_resource_id, |
(...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1430 if (load_counter) | 1432 if (load_counter) |
1431 *load_counter += 1; | 1433 *load_counter += 1; |
1432 base::MessageLoop::current()->PostTask( | 1434 base::MessageLoop::current()->PostTask( |
1433 FROM_HERE, | 1435 FROM_HERE, |
1434 base::Bind(callback, | 1436 base::Bind(callback, |
1435 HTTP_SUCCESS, | 1437 HTTP_SUCCESS, |
1436 base::Passed(&resource_list))); | 1438 base::Passed(&resource_list))); |
1437 } | 1439 } |
1438 | 1440 |
1439 } // namespace google_apis | 1441 } // namespace google_apis |
OLD | NEW |