Chromium Code Reviews| Index: extensions/browser/extension_prefs.h |
| diff --git a/extensions/browser/extension_prefs.h b/extensions/browser/extension_prefs.h |
| index 98a2e872a5024b97c13827d78dfc6ebabe48a225..ba0f75409784a1f024024d37c37f611646cb2f4c 100644 |
| --- a/extensions/browser/extension_prefs.h |
| +++ b/extensions/browser/extension_prefs.h |
| @@ -38,7 +38,6 @@ class PrefRegistrySyncable; |
| namespace extensions { |
| class AppSorting; |
| -class ContentSettingsStore; |
| class ExtensionPrefsUninstallExtension; |
| class URLPatternSet; |
| @@ -128,13 +127,31 @@ class ExtensionPrefs : public ExtensionScopedPrefs, public KeyedService { |
| // Called when the reasons for an extension being disabled have changed. |
| virtual void OnExtensionDisableReasonsChanged( |
| const std::string& extension_id, |
| - int disabled_reasons) = 0; |
| + int disabled_reasons) {} |
| + |
| + // Called when an extension is registered with ExtensionPrefs. |
| + virtual void OnExtensionRegistered(const std::string& extension_id, |
| + const base::Time& install_time, |
| + bool is_enabled) {} |
| + |
| + // Called when an extension's prefs have been loaded. |
| + virtual void OnExtensionPrefsLoaded(const std::string& extension_id) {} |
| + |
| + // Called when an extension's prefs are deleted. |
| + virtual void OnExtensionPrefsDeleted(const std::string& extension_id) {} |
| + |
| + // Called when an extension's enabled state pref is changed. |
| + virtual void OnExtensionStateChanged(const std::string& extension_id, |
| + bool state) {} |
| }; |
| - // Creates and initializes an ExtensionPrefs object. |
| - // Does not take ownership of |prefs| and |extension_pref_value_map|. |
| + // Creates an ExtensionPrefs object. |
| + // Does not take ownership of |prefs| or |extension_pref_value_map|. |
| // If |extensions_disabled| is true, extension controlled preferences and |
| // content settings do not become effective. |
| + // The Initialize method be called before an ExtensionPrefs is ready for |
| + // general use. This is to allow observers to be registered between |
|
James Cook
2014/04/01 18:45:03
Could you instead call ExtensionsBrowserClient::Ge
Ken Rockot(use gerrit already)
2014/04/01 21:34:59
I was going to do that, but it looked like someone
|
| + // construction and initialization. |
| static ExtensionPrefs* Create( |
| PrefService* prefs, |
| const base::FilePath& root_dir, |
| @@ -166,6 +183,11 @@ class ExtensionPrefs : public ExtensionScopedPrefs, public KeyedService { |
| void AddObserver(Observer* observer); |
| void RemoveObserver(Observer* observer); |
| + // Initializes the prefs. Only AddObserver or RemoveObserver should be called |
| + // on an instance of ExtensionPrefs before its Initialize method has been |
| + // callbed. |
|
James Cook
2014/04/01 18:45:03
callbed -> called
Ken Rockot(use gerrit already)
2014/04/01 21:34:59
Done.
|
| + void Initialize(); |
| + |
| // Returns true if the specified external extension was uninstalled by the |
| // user. |
| bool IsExternalExtensionUninstalled(const std::string& id) const; |
| @@ -515,10 +537,6 @@ class ExtensionPrefs : public ExtensionScopedPrefs, public KeyedService { |
| bool extensions_disabled() const { return extensions_disabled_; } |
| - ContentSettingsStore* content_settings_store() { |
| - return content_settings_store_.get(); |
| - } |
| - |
| // The underlying PrefService. |
| PrefService* pref_service() const { return prefs_; } |
| @@ -669,6 +687,8 @@ class ExtensionPrefs : public ExtensionScopedPrefs, public KeyedService { |
| const std::string& install_parameter, |
| base::DictionaryValue* extension_dict); |
| + void InitExtensionControlledPrefs(ExtensionPrefValueMap* value_map); |
| + |
| // Helper function to complete initialization of the values in |
| // |extension_dict| for an extension install. Also see |
| // PopulateExtensionInfoPrefs(). |
| @@ -693,8 +713,6 @@ class ExtensionPrefs : public ExtensionScopedPrefs, public KeyedService { |
| // properties. |
| scoped_ptr<AppSorting> app_sorting_; |
| - scoped_refptr<ContentSettingsStore> content_settings_store_; |
| - |
| scoped_ptr<TimeProvider> time_provider_; |
| bool extensions_disabled_; |