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

Side by Side Diff: chrome/browser/chromeos/extensions/file_browser_private_api.cc

Issue 9700011: Convert file url to lowercase to make it match a file handler pattern. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More careful UTF8 handling Created 8 years, 9 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
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/chromeos/extensions/file_browser_private_api.h" 5 #include "chrome/browser/chromeos/extensions/file_browser_private_api.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 bool GetFileTasksFileBrowserFunction::RunImpl() { 540 bool GetFileTasksFileBrowserFunction::RunImpl() {
541 ListValue* files_list = NULL; 541 ListValue* files_list = NULL;
542 if (!args_->GetList(0, &files_list)) 542 if (!args_->GetList(0, &files_list))
543 return false; 543 return false;
544 544
545 std::vector<GURL> file_urls; 545 std::vector<GURL> file_urls;
546 for (size_t i = 0; i < files_list->GetSize(); ++i) { 546 for (size_t i = 0; i < files_list->GetSize(); ++i) {
547 std::string file_url; 547 std::string file_url;
548 if (!files_list->GetString(i, &file_url)) 548 if (!files_list->GetString(i, &file_url))
549 return false; 549 return false;
550
551 // We need case-insensitive matching, and pattern in handler is already
552 // in lower case.
553 StringToLowerASCII(&file_url);
554 file_urls.push_back(GURL(file_url)); 550 file_urls.push_back(GURL(file_url));
555 } 551 }
556 552
557 ListValue* result_list = new ListValue(); 553 ListValue* result_list = new ListValue();
558 result_.reset(result_list); 554 result_.reset(result_list);
559 555
560 file_handler_util::LastUsedHandlerList common_tasks; 556 file_handler_util::LastUsedHandlerList common_tasks;
561 if (!file_handler_util::FindCommonTasks(profile_, file_urls, &common_tasks)) 557 if (!file_handler_util::FindCommonTasks(profile_, file_urls, &common_tasks))
562 return false; 558 return false;
563 559
(...skipping 1142 matching lines...) Expand 10 before | Expand all | Expand 10 after
1706 local_paths_->Append(Value::CreateStringValue("")); 1702 local_paths_->Append(Value::CreateStringValue(""));
1707 DVLOG(1) << "Failed to get " << gdata_path.value() 1703 DVLOG(1) << "Failed to get " << gdata_path.value()
1708 << " with error code: " << error; 1704 << " with error code: " << error;
1709 } 1705 }
1710 1706
1711 remaining_gdata_paths_.pop(); 1707 remaining_gdata_paths_.pop();
1712 1708
1713 // Start getting the next file. 1709 // Start getting the next file.
1714 GetFileOrSendResponse(); 1710 GetFileOrSendResponse();
1715 } 1711 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698