OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chrome_app_sorting.h" | 5 #include "chrome/browser/extensions/chrome_app_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 28 matching lines...) Expand all Loading... |
39 //////////////////////////////////////////////////////////////////////////////// | 39 //////////////////////////////////////////////////////////////////////////////// |
40 // ChromeAppSorting::AppOrdinals | 40 // ChromeAppSorting::AppOrdinals |
41 | 41 |
42 ChromeAppSorting::AppOrdinals::AppOrdinals() {} | 42 ChromeAppSorting::AppOrdinals::AppOrdinals() {} |
43 | 43 |
44 ChromeAppSorting::AppOrdinals::~AppOrdinals() {} | 44 ChromeAppSorting::AppOrdinals::~AppOrdinals() {} |
45 | 45 |
46 //////////////////////////////////////////////////////////////////////////////// | 46 //////////////////////////////////////////////////////////////////////////////// |
47 // ChromeAppSorting | 47 // ChromeAppSorting |
48 | 48 |
49 ChromeAppSorting::ChromeAppSorting(ExtensionScopedPrefs* extension_scoped_prefs) | 49 ChromeAppSorting::ChromeAppSorting() |
50 : extension_scoped_prefs_(extension_scoped_prefs), | 50 : extension_scoped_prefs_(NULL), |
51 extension_sync_service_(NULL), | 51 extension_sync_service_(NULL), |
52 default_ordinals_created_(false) { | 52 default_ordinals_created_(false) { |
53 } | 53 } |
54 | 54 |
55 ChromeAppSorting::~ChromeAppSorting() { | 55 ChromeAppSorting::~ChromeAppSorting() { |
56 } | 56 } |
57 | 57 |
| 58 void ChromeAppSorting::SetExtensionScopedPrefs(ExtensionScopedPrefs* prefs) { |
| 59 extension_scoped_prefs_ = prefs; |
| 60 } |
| 61 |
58 void ChromeAppSorting::SetExtensionSyncService( | 62 void ChromeAppSorting::SetExtensionSyncService( |
59 ExtensionSyncService* extension_sync_service) { | 63 ExtensionSyncService* extension_sync_service) { |
60 extension_sync_service_ = extension_sync_service; | 64 extension_sync_service_ = extension_sync_service; |
61 } | 65 } |
62 | 66 |
63 void ChromeAppSorting::Initialize( | 67 void ChromeAppSorting::Initialize( |
64 const extensions::ExtensionIdList& extension_ids) { | 68 const extensions::ExtensionIdList& extension_ids) { |
65 InitializePageOrdinalMap(extension_ids); | 69 InitializePageOrdinalMap(extension_ids); |
66 | 70 |
67 MigrateAppIndex(extension_ids); | 71 MigrateAppIndex(extension_ids); |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 for (AppLaunchOrdinalMap::const_iterator it = m.begin(); it != m.end(); | 612 for (AppLaunchOrdinalMap::const_iterator it = m.begin(); it != m.end(); |
609 ++it) { | 613 ++it) { |
610 const std::string& id = it->second; | 614 const std::string& id = it->second; |
611 if (ntp_hidden_extensions_.count(id) == 0) | 615 if (ntp_hidden_extensions_.count(id) == 0) |
612 result++; | 616 result++; |
613 } | 617 } |
614 return result; | 618 return result; |
615 } | 619 } |
616 | 620 |
617 } // namespace extensions | 621 } // namespace extensions |
OLD | NEW |