| 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/extensions/extension_sorting.h" | 5 #include "chrome/browser/extensions/extension_sorting.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 const AppLaunchOrdinalMap& m) const { | 616 const AppLaunchOrdinalMap& m) const { |
| 617 size_t result = 0; | 617 size_t result = 0; |
| 618 for (AppLaunchOrdinalMap::const_iterator it = m.begin(); it != m.end(); | 618 for (AppLaunchOrdinalMap::const_iterator it = m.begin(); it != m.end(); |
| 619 ++it) { | 619 ++it) { |
| 620 const std::string& id = it->second; | 620 const std::string& id = it->second; |
| 621 if (ntp_hidden_extensions_.count(id) == 0) | 621 if (ntp_hidden_extensions_.count(id) == 0) |
| 622 result++; | 622 result++; |
| 623 } | 623 } |
| 624 return result; | 624 return result; |
| 625 } | 625 } |
| 626 |
| 627 void ExtensionSorting::GetOrderedExtensionIds( |
| 628 extensions::ExtensionIdList* out) const { |
| 629 for (PageOrdinalMap::const_iterator page_it = ntp_ordinal_map_.begin(); |
| 630 page_it != ntp_ordinal_map_.end(); ++page_it) { |
| 631 const AppLaunchOrdinalMap& page = page_it->second; |
| 632 for (AppLaunchOrdinalMap::const_iterator app_launch_it = page.begin(); |
| 633 app_launch_it != page.end(); ++app_launch_it) { |
| 634 out->push_back(app_launch_it->second); |
| 635 } |
| 636 } |
| 637 } |
| OLD | NEW |