diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-25 17:53:15 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-25 17:53:15 +0000 |
commit | 27b985db86e682c821f13ec37b52a6c69aa69fbb (patch) | |
tree | af9ed515ccc19ea7b9682afbe6de7d982e12d4c8 /chrome/browser/extensions/external_pref_extension_provider.h | |
parent | 8380c0910bfff5ee0af6b37536cd815023d055ef (diff) | |
download | chromium_src-27b985db86e682c821f13ec37b52a6c69aa69fbb.zip chromium_src-27b985db86e682c821f13ec37b52a6c69aa69fbb.tar.gz chromium_src-27b985db86e682c821f13ec37b52a6c69aa69fbb.tar.bz2 |
The Provider for External Extensions no longer uses
the prefs file, but instead reads a preferences file
(a json file called external_extensions.json).
This file specifies what external extensions we
installed (shipped with Chrome) and the extension
system takes care of installing them.
Having this in a separate file makes the upgrade
scenario easier, since we can during upgrade simply
blow away this file and replace it (and not have
to worry about merging/loosing user specified data).
The extension system will read the file, and figure
out whether any extension needs to be upgraded based
on the information provided.
Now, all external providers fetch data on the file
thread instead of reading and copying preferences on
the UI thread and posting them to the file thread.
BUG=http://crbug.com/14201
TEST=Covered by unit test.
Review URL: http://codereview.chromium.org/144018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19264 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/external_pref_extension_provider.h')
-rw-r--r-- | chrome/browser/extensions/external_pref_extension_provider.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/chrome/browser/extensions/external_pref_extension_provider.h b/chrome/browser/extensions/external_pref_extension_provider.h index a52be411..67d46e3 100644 --- a/chrome/browser/extensions/external_pref_extension_provider.h +++ b/chrome/browser/extensions/external_pref_extension_provider.h @@ -13,13 +13,17 @@ class DictionaryValue; class Version; -// A specialization of the ExternalExtensionProvider that uses preferences to +// A specialization of the ExternalExtensionProvider that uses a json file to // look up which external extensions are registered. class ExternalPrefExtensionProvider : public ExternalExtensionProvider { public: - explicit ExternalPrefExtensionProvider(DictionaryValue* prefs); + explicit ExternalPrefExtensionProvider(); virtual ~ExternalPrefExtensionProvider(); + // Used only during testing to not use the json file for external extensions, + // but instead parse a json file specified by the test. + void SetPreferencesForTesting(std::string json_data_for_testing); + // ExternalExtensionProvider implementation: virtual void VisitRegisteredExtension( Visitor* visitor, const std::set<std::string>& ids_to_ignore) const; @@ -28,6 +32,9 @@ class ExternalPrefExtensionProvider : public ExternalExtensionProvider { Extension::Location* location) const; protected: scoped_ptr<DictionaryValue> prefs_; + + private: + void SetPreferences(ValueSerializer* serializer); }; #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_PREF_EXTENSION_PROVIDER_H_ |