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

Side by Side Diff: chrome/browser/chromeos/file_manager/file_tasks.cc

Issue 2230203002: chrome: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed accidental components/ change Created 4 years, 4 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
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/file_manager/file_tasks.h" 5 #include "chrome/browser/chromeos/file_manager/file_tasks.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <map> 9 #include <map>
10 10
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 pref_service, mime_type, file_path.Extension()); 623 pref_service, mime_type, file_path.Extension());
624 default_task_ids.insert(task_id); 624 default_task_ids.insert(task_id);
625 } 625 }
626 626
627 // Go through all the tasks from the beginning and see if there is any 627 // Go through all the tasks from the beginning and see if there is any
628 // default task. If found, pick and set it as default and return. 628 // default task. If found, pick and set it as default and return.
629 for (size_t i = 0; i < tasks->size(); ++i) { 629 for (size_t i = 0; i < tasks->size(); ++i) {
630 FullTaskDescriptor* task = &tasks->at(i); 630 FullTaskDescriptor* task = &tasks->at(i);
631 DCHECK(!task->is_default()); 631 DCHECK(!task->is_default());
632 const std::string task_id = TaskDescriptorToId(task->task_descriptor()); 632 const std::string task_id = TaskDescriptorToId(task->task_descriptor());
633 if (ContainsKey(default_task_ids, task_id)) { 633 if (base::ContainsKey(default_task_ids, task_id)) {
634 task->set_is_default(true); 634 task->set_is_default(true);
635 return; 635 return;
636 } 636 }
637 } 637 }
638 638
639 // No default tasks found. If there is any fallback file browser handler, 639 // No default tasks found. If there is any fallback file browser handler,
640 // make it as default task, so it's selected by default. 640 // make it as default task, so it's selected by default.
641 for (size_t i = 0; i < tasks->size(); ++i) { 641 for (size_t i = 0; i < tasks->size(); ++i) {
642 FullTaskDescriptor* task = &tasks->at(i); 642 FullTaskDescriptor* task = &tasks->at(i);
643 DCHECK(!task->is_default()); 643 DCHECK(!task->is_default());
644 if (IsFallbackFileHandler(task->task_descriptor())) { 644 if (IsFallbackFileHandler(task->task_descriptor())) {
645 task->set_is_default(true); 645 task->set_is_default(true);
646 return; 646 return;
647 } 647 }
648 } 648 }
649 } 649 }
650 650
651 } // namespace file_tasks 651 } // namespace file_tasks
652 } // namespace file_manager 652 } // namespace file_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698