| 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 #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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |