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

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

Issue 9340007: Make the Chrome Web Store Icon Syncable (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Removing braces Created 8 years, 10 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 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 12 matching lines...) Expand all
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
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_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service_unittest.cc ('k') | chrome/browser/extensions/extension_sorting.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698