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

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: Rebase 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/file_handler_util.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/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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 bool GetFileTasksFileBrowserFunction::RunImpl() { 541 bool GetFileTasksFileBrowserFunction::RunImpl() {
542 ListValue* files_list = NULL; 542 ListValue* files_list = NULL;
543 if (!args_->GetList(0, &files_list)) 543 if (!args_->GetList(0, &files_list))
544 return false; 544 return false;
545 545
546 std::vector<GURL> file_urls; 546 std::vector<GURL> file_urls;
547 for (size_t i = 0; i < files_list->GetSize(); ++i) { 547 for (size_t i = 0; i < files_list->GetSize(); ++i) {
548 std::string file_url; 548 std::string file_url;
549 if (!files_list->GetString(i, &file_url)) 549 if (!files_list->GetString(i, &file_url))
550 return false; 550 return false;
551
552 // We need case-insensitive matching, and pattern in handler is already
553 // in lower case.
554 StringToLowerASCII(&file_url);
555 file_urls.push_back(GURL(file_url)); 551 file_urls.push_back(GURL(file_url));
556 } 552 }
557 553
558 ListValue* result_list = new ListValue(); 554 ListValue* result_list = new ListValue();
559 result_.reset(result_list); 555 result_.reset(result_list);
560 556
561 file_handler_util::LastUsedHandlerList common_tasks; 557 file_handler_util::LastUsedHandlerList common_tasks;
562 if (!file_handler_util::FindCommonTasks(profile_, file_urls, &common_tasks)) 558 if (!file_handler_util::FindCommonTasks(profile_, file_urls, &common_tasks))
563 return false; 559 return false;
564 560
(...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after
1710 local_paths_->Append(Value::CreateStringValue("")); 1706 local_paths_->Append(Value::CreateStringValue(""));
1711 DVLOG(1) << "Failed to get " << gdata_path.value() 1707 DVLOG(1) << "Failed to get " << gdata_path.value()
1712 << " with error code: " << error; 1708 << " with error code: " << error;
1713 } 1709 }
1714 1710
1715 remaining_gdata_paths_.pop(); 1711 remaining_gdata_paths_.pop();
1716 1712
1717 // Start getting the next file. 1713 // Start getting the next file.
1718 GetFileOrSendResponse(); 1714 GetFileOrSendResponse();
1719 } 1715 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/file_handler_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698