| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 // Properly initialize ExtensionSorting internal values that require | 24 // Properly initialize ExtensionSorting internal values that require |
| 25 // |extension_ids|. | 25 // |extension_ids|. |
| 26 void Initialize(const ExtensionPrefs::ExtensionIdSet& extension_ids); | 26 void Initialize(const ExtensionPrefs::ExtensionIdSet& extension_ids); |
| 27 | 27 |
| 28 // Resolves any conflicts the might be created as a result of syncing that | 28 // Resolves any conflicts the might be created as a result of syncing that |
| 29 // results in two icons having the same page and app launch ordinal. After | 29 // results in two icons having the same page and app launch ordinal. After |
| 30 // this is called it is guaranteed that there are no collisions of NTP icons. | 30 // this is called it is guaranteed that there are no collisions of NTP icons. |
| 31 void FixNTPOrdinalCollisions(); | 31 void FixNTPOrdinalCollisions(); |
| 32 | 32 |
| 33 // This ensures that the extension has valid ordinals, and if it doesn't then |
| 34 // properly initialize them. |
| 35 void EnsureValidOrdinals(const std::string& extension_id); |
| 36 |
| 33 // Updates the app launcher value for the moved extension so that it is now | 37 // Updates the app launcher value for the moved extension so that it is now |
| 34 // located after the given predecessor and before the successor. | 38 // located after the given predecessor and before the successor. |
| 35 // Empty strings are used to indicate no successor or predecessor. | 39 // Empty strings are used to indicate no successor or predecessor. |
| 36 void OnExtensionMoved(const std::string& moved_extension_id, | 40 void OnExtensionMoved(const std::string& moved_extension_id, |
| 37 const std::string& predecessor_extension_id, | 41 const std::string& predecessor_extension_id, |
| 38 const std::string& successor_extension_id); | 42 const std::string& successor_extension_id); |
| 39 | 43 |
| 40 // Get the application launch ordinal for an app with |extension_id|. This | 44 // Get the application launch ordinal for an app with |extension_id|. This |
| 41 // determines the order in which the app appears on the page it's on in the | 45 // determines the order in which the app appears on the page it's on in the |
| 42 // New Tab Page (Note that you can compare app launch ordinals only if the | 46 // New Tab Page (Note that you can compare app launch ordinals only if the |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 // The StringOrdinal is the page ordinal and the AppLaunchOrdinalMap is the | 150 // The StringOrdinal is the page ordinal and the AppLaunchOrdinalMap is the |
| 147 // contents of that page. | 151 // contents of that page. |
| 148 typedef std::map< | 152 typedef std::map< |
| 149 StringOrdinal, AppLaunchOrdinalMap, StringOrdinalLessThan> PageOrdinalMap; | 153 StringOrdinal, AppLaunchOrdinalMap, StringOrdinalLessThan> PageOrdinalMap; |
| 150 PageOrdinalMap ntp_ordinal_map_; | 154 PageOrdinalMap ntp_ordinal_map_; |
| 151 | 155 |
| 152 DISALLOW_COPY_AND_ASSIGN(ExtensionSorting); | 156 DISALLOW_COPY_AND_ASSIGN(ExtensionSorting); |
| 153 }; | 157 }; |
| 154 | 158 |
| 155 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SORTING_H_ | 159 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SORTING_H_ |
| OLD | NEW |