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

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

Issue 16032004: Call CreateDefaultOrdinals() when needed, instead of on construction (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 void SyncIfNeeded(const std::string& extension_id); 178 void SyncIfNeeded(const std::string& extension_id);
179 179
180 // Creates the default ordinals. 180 // Creates the default ordinals.
181 void CreateDefaultOrdinals(); 181 void CreateDefaultOrdinals();
182 182
183 // Gets the default ordinals for |extension_id|. Returns false if no default 183 // Gets the default ordinals for |extension_id|. Returns false if no default
184 // ordinals for |extension_id| is defined. Otherwise, returns true and 184 // ordinals for |extension_id| is defined. Otherwise, returns true and
185 // ordinals is updated with corresponding ordinals. 185 // ordinals is updated with corresponding ordinals.
186 bool GetDefaultOrdinals(const std::string& extension_id, 186 bool GetDefaultOrdinals(const std::string& extension_id,
187 syncer::StringOrdinal* page_ordinal, 187 syncer::StringOrdinal* page_ordinal,
188 syncer::StringOrdinal* app_launch_ordinal) const; 188 syncer::StringOrdinal* app_launch_ordinal);
189 189
190 // Returns |app_launch_ordinal| if it has no collision in the page specified 190 // Returns |app_launch_ordinal| if it has no collision in the page specified
191 // by |page_ordinal|. Otherwise, returns an ordinal after |app_launch_ordinal| 191 // by |page_ordinal|. Otherwise, returns an ordinal after |app_launch_ordinal|
192 // that has no conflict. 192 // that has no conflict.
193 syncer::StringOrdinal ResolveCollision( 193 syncer::StringOrdinal ResolveCollision(
194 const syncer::StringOrdinal& page_ordinal, 194 const syncer::StringOrdinal& page_ordinal,
195 const syncer::StringOrdinal& app_launch_ordinal) const; 195 const syncer::StringOrdinal& app_launch_ordinal) const;
196 196
197 // Returns the number of items in |m| visible on the new tab page. 197 // Returns the number of items in |m| visible on the new tab page.
198 size_t CountItemsVisibleOnNtp(const AppLaunchOrdinalMap& m) const; 198 size_t CountItemsVisibleOnNtp(const AppLaunchOrdinalMap& m) const;
(...skipping 14 matching lines...) Expand all
213 // Defines the default ordinals. 213 // Defines the default ordinals.
214 AppOrdinalsMap default_ordinals_; 214 AppOrdinalsMap default_ordinals_;
215 215
216 // The set of extensions that don't appear in the new tab page. 216 // The set of extensions that don't appear in the new tab page.
217 std::set<std::string> ntp_hidden_extensions_; 217 std::set<std::string> ntp_hidden_extensions_;
218 218
219 DISALLOW_COPY_AND_ASSIGN(ExtensionSorting); 219 DISALLOW_COPY_AND_ASSIGN(ExtensionSorting);
220 }; 220 };
221 221
222 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SORTING_H_ 222 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SORTING_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_sorting.cc » ('j') | chrome/browser/extensions/extension_sorting.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698