| 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|. | 24 // Properly initializes internal values that require |extension_ids|. |
| 34 // SetExtensionScopedPrefs must have been called prior to this. | 25 // SetExtensionScopedPrefs must have been called prior to this. |
| 35 virtual void Initialize(const extensions::ExtensionIdList& extension_ids) = 0; | 26 virtual void Initialize(const extensions::ExtensionIdList& extension_ids) = 0; |
| 36 | 27 |
| 37 // 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 |
| 38 // 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 |
| 39 // 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. |
| 40 virtual void FixNTPOrdinalCollisions() = 0; | 31 virtual void FixNTPOrdinalCollisions() = 0; |
| 41 | 32 |
| 42 // This ensures that the extension has valid ordinals, and if it doesn't then | 33 // This ensures that the extension has valid ordinals, and if it doesn't then |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 virtual void SetExtensionVisible(const std::string& extension_id, | 105 virtual void SetExtensionVisible(const std::string& extension_id, |
| 115 bool visible) = 0; | 106 bool visible) = 0; |
| 116 | 107 |
| 117 private: | 108 private: |
| 118 DISALLOW_COPY_AND_ASSIGN(AppSorting); | 109 DISALLOW_COPY_AND_ASSIGN(AppSorting); |
| 119 }; | 110 }; |
| 120 | 111 |
| 121 } // namespace extensions | 112 } // namespace extensions |
| 122 | 113 |
| 123 #endif // EXTENSIONS_BROWSER_APP_SORTING_H_ | 114 #endif // EXTENSIONS_BROWSER_APP_SORTING_H_ |
| OLD | NEW |