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

Side by Side Diff: chrome/browser/extensions/extension_sorting.h

Issue 17038002: Separate the NTP app ordering from the app list app ordering (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rework + fix tests Created 7 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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SORTING_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SORTING_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SORTING_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SORTING_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 int PageStringOrdinalAsInteger( 97 int PageStringOrdinalAsInteger(
98 const syncer::StringOrdinal& page_ordinal) const; 98 const syncer::StringOrdinal& page_ordinal) const;
99 99
100 // Converts the page index integer to its StringOrdinal equivalent. This takes 100 // Converts the page index integer to its StringOrdinal equivalent. This takes
101 // O(# of apps) worst-case. 101 // O(# of apps) worst-case.
102 syncer::StringOrdinal PageIntegerAsStringOrdinal(size_t page_index); 102 syncer::StringOrdinal PageIntegerAsStringOrdinal(size_t page_index);
103 103
104 // Hidden extensions don't appear in the new tab page. 104 // Hidden extensions don't appear in the new tab page.
105 void MarkExtensionAsHidden(const std::string& extension_id); 105 void MarkExtensionAsHidden(const std::string& extension_id);
106 106
107 // Returns all extension ids in the sorting in an vector ordered according to
108 // this sorting.
109 void GetOrderedExtensionIds(extensions::ExtensionIdList* out) const;
110
107 private: 111 private:
108 // The StringOrdinal is the app launch ordinal and the string is the extension 112 // The StringOrdinal is the app launch ordinal and the string is the extension
109 // id. 113 // id.
110 typedef std::multimap< 114 typedef std::multimap<
111 syncer::StringOrdinal, std::string, 115 syncer::StringOrdinal, std::string,
112 syncer::StringOrdinal::LessThanFn> AppLaunchOrdinalMap; 116 syncer::StringOrdinal::LessThanFn> AppLaunchOrdinalMap;
113 // The StringOrdinal is the page ordinal and the AppLaunchOrdinalMap is the 117 // The StringOrdinal is the page ordinal and the AppLaunchOrdinalMap is the
114 // contents of that page. 118 // contents of that page.
115 typedef std::map< 119 typedef std::map<
116 syncer::StringOrdinal, AppLaunchOrdinalMap, 120 syncer::StringOrdinal, AppLaunchOrdinalMap,
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 // construction when the app order may not have been determined. 219 // construction when the app order may not have been determined.
216 bool default_ordinals_created_; 220 bool default_ordinals_created_;
217 221
218 // The set of extensions that don't appear in the new tab page. 222 // The set of extensions that don't appear in the new tab page.
219 std::set<std::string> ntp_hidden_extensions_; 223 std::set<std::string> ntp_hidden_extensions_;
220 224
221 DISALLOW_COPY_AND_ASSIGN(ExtensionSorting); 225 DISALLOW_COPY_AND_ASSIGN(ExtensionSorting);
222 }; 226 };
223 227
224 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SORTING_H_ 228 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SORTING_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698