| 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 class ExtensionSyncService; | |
| 15 | |
| 16 namespace extensions { | 14 namespace extensions { |
| 17 | 15 |
| 18 class ExtensionScopedPrefs; | 16 class ExtensionScopedPrefs; |
| 19 | 17 |
| 20 // 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. |
| 21 class AppSorting { | 19 class AppSorting { |
| 22 public: | 20 public: |
| 23 AppSorting() {} | 21 AppSorting() {} |
| 24 virtual ~AppSorting() {} | 22 virtual ~AppSorting() {} |
| 25 | 23 |
| 26 // Sets the object used to look up preferences. Ownership remains with the | 24 // Sets the object used to look up preferences. Ownership remains with the |
| 27 // caller. | 25 // caller. |
| 28 virtual void SetExtensionScopedPrefs(ExtensionScopedPrefs* prefs) = 0; | 26 virtual void SetExtensionScopedPrefs(ExtensionScopedPrefs* prefs) = 0; |
| 29 | 27 |
| 30 // CHECKs that SetExtensionScopedPrefs has been called with a non-null object. | 28 // CHECKs that SetExtensionScopedPrefs has been called with a non-null object. |
| 31 // TODO(mgiuca): Added this to try and diagnose http://crbug.com/476648. | 29 // TODO(mgiuca): Added this to try and diagnose http://crbug.com/476648. |
| 32 // Remove it after the investigation is concluded. | 30 // Remove it after the investigation is concluded. |
| 33 virtual void CheckExtensionScopedPrefs() const = 0; | 31 virtual void CheckExtensionScopedPrefs() const = 0; |
| 34 | 32 |
| 35 // Sets up the ExtensionSyncService to inform of changes that require syncing. | |
| 36 virtual void SetExtensionSyncService( | |
| 37 ExtensionSyncService* extension_sync_service) = 0; | |
| 38 | |
| 39 // Properly initializes internal values that require |extension_ids|. | 33 // Properly initializes internal values that require |extension_ids|. |
| 40 // SetExtensionScopedPrefs must have been called prior to this. | 34 // SetExtensionScopedPrefs must have been called prior to this. |
| 41 virtual void Initialize(const extensions::ExtensionIdList& extension_ids) = 0; | 35 virtual void Initialize(const extensions::ExtensionIdList& extension_ids) = 0; |
| 42 | 36 |
| 43 // Resolves any conflicts the might be created as a result of syncing that | 37 // Resolves any conflicts the might be created as a result of syncing that |
| 44 // results in two icons having the same page and app launch ordinal. After | 38 // results in two icons having the same page and app launch ordinal. After |
| 45 // this is called it is guaranteed that there are no collisions of NTP icons. | 39 // this is called it is guaranteed that there are no collisions of NTP icons. |
| 46 virtual void FixNTPOrdinalCollisions() = 0; | 40 virtual void FixNTPOrdinalCollisions() = 0; |
| 47 | 41 |
| 48 // This ensures that the extension has valid ordinals, and if it doesn't then | 42 // 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... |
| 120 virtual void SetExtensionVisible(const std::string& extension_id, | 114 virtual void SetExtensionVisible(const std::string& extension_id, |
| 121 bool visible) = 0; | 115 bool visible) = 0; |
| 122 | 116 |
| 123 private: | 117 private: |
| 124 DISALLOW_COPY_AND_ASSIGN(AppSorting); | 118 DISALLOW_COPY_AND_ASSIGN(AppSorting); |
| 125 }; | 119 }; |
| 126 | 120 |
| 127 } // namespace extensions | 121 } // namespace extensions |
| 128 | 122 |
| 129 #endif // EXTENSIONS_BROWSER_APP_SORTING_H_ | 123 #endif // EXTENSIONS_BROWSER_APP_SORTING_H_ |
| OLD | NEW |