OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 EXTENSIONS_BROWSER_APP_SORTING_H_ | 5 #ifndef EXTENSIONS_BROWSER_APP_SORTING_H_ |
6 #define EXTENSIONS_BROWSER_APP_SORTING_H_ | 6 #define EXTENSIONS_BROWSER_APP_SORTING_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "extensions/common/extension.h" | 11 #include "extensions/common/extension.h" |
12 #include "sync/api/string_ordinal.h" | 12 #include "sync/api/string_ordinal.h" |
13 | 13 |
14 namespace extensions { | 14 namespace extensions { |
15 | 15 |
16 class ExtensionScopedPrefs; | 16 class ExtensionScopedPrefs; |
17 | 17 |
18 // An interface that provides a fixed ordering for a set of apps. | 18 // An interface that provides a fixed ordering for a set of apps. |
19 class AppSorting { | 19 class AppSorting { |
20 public: | 20 public: |
21 AppSorting() {} | 21 AppSorting() {} |
22 virtual ~AppSorting() {} | 22 virtual ~AppSorting() {} |
23 | 23 |
24 // Sets the object used to look up preferences. Ownership remains with the | |
25 // caller. | |
26 virtual void SetExtensionScopedPrefs(ExtensionScopedPrefs* prefs) = 0; | |
27 | |
28 // CHECKs that SetExtensionScopedPrefs has been called with a non-null object. | |
29 // TODO(mgiuca): Added this to try and diagnose http://crbug.com/476648. | |
30 // Remove it after the investigation is concluded. | |
31 virtual void CheckExtensionScopedPrefs() const = 0; | |
32 | |
33 // Properly initializes internal values that require |extension_ids|. | |
34 // SetExtensionScopedPrefs must have been called prior to this. | |
35 virtual void Initialize(const extensions::ExtensionIdList& extension_ids) = 0; | |
36 | |
37 // Resolves any conflicts the might be created as a result of syncing that | 24 // Resolves any conflicts the might be created as a result of syncing that |
38 // results in two icons having the same page and app launch ordinal. After | 25 // results in two icons having the same page and app launch ordinal. After |
39 // this is called it is guaranteed that there are no collisions of NTP icons. | 26 // this is called it is guaranteed that there are no collisions of NTP icons. |
40 virtual void FixNTPOrdinalCollisions() = 0; | 27 virtual void FixNTPOrdinalCollisions() = 0; |
41 | 28 |
42 // This ensures that the extension has valid ordinals, and if it doesn't then | 29 // This ensures that the extension has valid ordinals, and if it doesn't then |
43 // properly initialize them. |suggested_page| will be used if it is valid and | 30 // properly initialize them. |suggested_page| will be used if it is valid and |
44 // the extension has no valid user-set page ordinal. | 31 // the extension has no valid user-set page ordinal. |
45 virtual void EnsureValidOrdinals( | 32 virtual void EnsureValidOrdinals( |
46 const std::string& extension_id, | 33 const std::string& extension_id, |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 virtual void SetExtensionVisible(const std::string& extension_id, | 101 virtual void SetExtensionVisible(const std::string& extension_id, |
115 bool visible) = 0; | 102 bool visible) = 0; |
116 | 103 |
117 private: | 104 private: |
118 DISALLOW_COPY_AND_ASSIGN(AppSorting); | 105 DISALLOW_COPY_AND_ASSIGN(AppSorting); |
119 }; | 106 }; |
120 | 107 |
121 } // namespace extensions | 108 } // namespace extensions |
122 | 109 |
123 #endif // EXTENSIONS_BROWSER_APP_SORTING_H_ | 110 #endif // EXTENSIONS_BROWSER_APP_SORTING_H_ |
OLD | NEW |