| Index: extensions/browser/extension_prefs.h
|
| diff --git a/extensions/browser/extension_prefs.h b/extensions/browser/extension_prefs.h
|
| index 98a2e872a5024b97c13827d78dfc6ebabe48a225..414d6c1a7628a75064d6c03dd38d2761552cee9d 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,29 +127,46 @@ 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.
|
| - static ExtensionPrefs* Create(
|
| - PrefService* prefs,
|
| - const base::FilePath& root_dir,
|
| - ExtensionPrefValueMap* extension_pref_value_map,
|
| - scoped_ptr<AppSorting> app_sorting,
|
| - bool extensions_disabled);
|
| + // content settings do not become effective. Observers should be included
|
| + // in |early_observers| if they need to observe events which occur during
|
| + // initialization of the ExtensionPrefs object.
|
| + static ExtensionPrefs* Create(PrefService* prefs,
|
| + const base::FilePath& root_dir,
|
| + ExtensionPrefValueMap* extension_pref_value_map,
|
| + scoped_ptr<AppSorting> app_sorting,
|
| + bool extensions_disabled,
|
| + const std::vector<Observer*>& early_observers);
|
|
|
| // A version of Create which allows injection of a custom base::Time provider.
|
| // Use this as needed for testing.
|
| - static ExtensionPrefs* Create(
|
| - PrefService* prefs,
|
| - const base::FilePath& root_dir,
|
| - ExtensionPrefValueMap* extension_pref_value_map,
|
| - scoped_ptr<AppSorting> app_sorting,
|
| - bool extensions_disabled,
|
| - scoped_ptr<TimeProvider> time_provider);
|
| + static ExtensionPrefs* Create(PrefService* prefs,
|
| + const base::FilePath& root_dir,
|
| + ExtensionPrefValueMap* extension_pref_value_map,
|
| + scoped_ptr<AppSorting> app_sorting,
|
| + bool extensions_disabled,
|
| + const std::vector<Observer*>& early_observers,
|
| + scoped_ptr<TimeProvider> time_provider);
|
|
|
| virtual ~ExtensionPrefs();
|
|
|
| @@ -515,10 +531,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_; }
|
|
|
| @@ -568,7 +580,8 @@ class ExtensionPrefs : public ExtensionScopedPrefs, public KeyedService {
|
| ExtensionPrefValueMap* extension_pref_value_map,
|
| scoped_ptr<AppSorting> app_sorting,
|
| scoped_ptr<TimeProvider> time_provider,
|
| - bool extensions_disabled);
|
| + bool extensions_disabled,
|
| + const std::vector<Observer*>& early_observers);
|
|
|
| // Converts absolute paths in the pref to paths relative to the
|
| // install_directory_.
|
| @@ -669,6 +682,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 +708,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_;
|
|
|