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/chromeos/file_manager/file_browser_handlers.h" | 5 #include "chrome/browser/chromeos/file_manager/file_browser_handlers.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 common_handlers = handlers; | 513 common_handlers = handlers; |
514 } else { | 514 } else { |
515 // For all additional files, find intersection between the accumulated and | 515 // For all additional files, find intersection between the accumulated and |
516 // file specific set. | 516 // file specific set. |
517 FileBrowserHandlerList intersection; | 517 FileBrowserHandlerList intersection; |
518 std::set<const FileBrowserHandler*> common_handler_set( | 518 std::set<const FileBrowserHandler*> common_handler_set( |
519 common_handlers.begin(), common_handlers.end()); | 519 common_handlers.begin(), common_handlers.end()); |
520 | 520 |
521 for (FileBrowserHandlerList::const_iterator itr = handlers.begin(); | 521 for (FileBrowserHandlerList::const_iterator itr = handlers.begin(); |
522 itr != handlers.end(); ++itr) { | 522 itr != handlers.end(); ++itr) { |
523 if (ContainsKey(common_handler_set, *itr)) | 523 if (base::ContainsKey(common_handler_set, *itr)) |
524 intersection.push_back(*itr); | 524 intersection.push_back(*itr); |
525 } | 525 } |
526 | 526 |
527 std::swap(common_handlers, intersection); | 527 std::swap(common_handlers, intersection); |
528 if (common_handlers.empty()) | 528 if (common_handlers.empty()) |
529 return FileBrowserHandlerList(); | 529 return FileBrowserHandlerList(); |
530 } | 530 } |
531 } | 531 } |
532 | 532 |
533 return common_handlers; | 533 return common_handlers; |
534 } | 534 } |
535 | 535 |
536 } // namespace file_browser_handlers | 536 } // namespace file_browser_handlers |
537 } // namespace file_manager | 537 } // namespace file_manager |
OLD | NEW |