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

Side by Side Diff: extensions/browser/app_sorting.h

Issue 1055453007: Added CHECKs for null pointers in ChromeAppSorting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added CHECK(this) just to make sure that ExtensionPrefs is non-null. Created 5 years, 8 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
« no previous file with comments | « chrome/browser/extensions/chrome_app_sorting.cc ('k') | extensions/browser/extension_prefs.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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; 14 class ExtensionSyncService;
15 15
16 namespace extensions { 16 namespace extensions {
17 17
18 class ExtensionScopedPrefs; 18 class ExtensionScopedPrefs;
19 19
20 // An interface that provides a fixed ordering for a set of apps. 20 // An interface that provides a fixed ordering for a set of apps.
21 class AppSorting { 21 class AppSorting {
22 public: 22 public:
23 AppSorting() {} 23 AppSorting() {}
24 virtual ~AppSorting() {} 24 virtual ~AppSorting() {}
25 25
26 // Sets the object used to look up preferences. Ownership remains with the 26 // Sets the object used to look up preferences. Ownership remains with the
27 // caller. 27 // caller.
28 virtual void SetExtensionScopedPrefs(ExtensionScopedPrefs* prefs) = 0; 28 virtual void SetExtensionScopedPrefs(ExtensionScopedPrefs* prefs) = 0;
29 29
30 // CHECKs that SetExtensionScopedPrefs has been called with a non-null object.
31 // TODO(mgiuca): Added this to try and diagnose http://crbug.com/476648.
32 // Remove it after the investigation is concluded.
33 virtual void CheckExtensionScopedPrefs() const = 0;
34
30 // Sets up the ExtensionSyncService to inform of changes that require syncing. 35 // Sets up the ExtensionSyncService to inform of changes that require syncing.
31 virtual void SetExtensionSyncService( 36 virtual void SetExtensionSyncService(
32 ExtensionSyncService* extension_sync_service) = 0; 37 ExtensionSyncService* extension_sync_service) = 0;
33 38
34 // Properly initializes internal values that require |extension_ids|. 39 // Properly initializes internal values that require |extension_ids|.
40 // SetExtensionScopedPrefs must have been called prior to this.
35 virtual void Initialize(const extensions::ExtensionIdList& extension_ids) = 0; 41 virtual void Initialize(const extensions::ExtensionIdList& extension_ids) = 0;
36 42
37 // Resolves any conflicts the might be created as a result of syncing that 43 // 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 44 // 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. 45 // this is called it is guaranteed that there are no collisions of NTP icons.
40 virtual void FixNTPOrdinalCollisions() = 0; 46 virtual void FixNTPOrdinalCollisions() = 0;
41 47
42 // This ensures that the extension has valid ordinals, and if it doesn't then 48 // 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 49 // properly initialize them. |suggested_page| will be used if it is valid and
44 // the extension has no valid user-set page ordinal. 50 // the extension has no valid user-set page ordinal.
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 virtual void SetExtensionVisible(const std::string& extension_id, 120 virtual void SetExtensionVisible(const std::string& extension_id,
115 bool visible) = 0; 121 bool visible) = 0;
116 122
117 private: 123 private:
118 DISALLOW_COPY_AND_ASSIGN(AppSorting); 124 DISALLOW_COPY_AND_ASSIGN(AppSorting);
119 }; 125 };
120 126
121 } // namespace extensions 127 } // namespace extensions
122 128
123 #endif // EXTENSIONS_BROWSER_APP_SORTING_H_ 129 #endif // EXTENSIONS_BROWSER_APP_SORTING_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/chrome_app_sorting.cc ('k') | extensions/browser/extension_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698