diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-09 19:55:19 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-09 19:55:19 +0000 |
commit | e8c729aac97f4059a8bf7c2e880aceb9eb683e12 (patch) | |
tree | 0949a984c47c3184563b243bb77e9080d242ec50 /chrome/browser/extensions/extension_prefs.cc | |
parent | 753efc479384c254e263fd11390846a060fa6ce0 (diff) | |
download | chromium_src-e8c729aac97f4059a8bf7c2e880aceb9eb683e12.zip chromium_src-e8c729aac97f4059a8bf7c2e880aceb9eb683e12.tar.gz chromium_src-e8c729aac97f4059a8bf7c2e880aceb9eb683e12.tar.bz2 |
Persistent "Load unpacked extension" extensions across browser restarts.
BUG=24850
Review URL: http://codereview.chromium.org/681001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41068 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_prefs.cc')
-rw-r--r-- | chrome/browser/extensions/extension_prefs.cc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc index 388172d..10c5056 100644 --- a/chrome/browser/extensions/extension_prefs.cc +++ b/chrome/browser/extensions/extension_prefs.cc @@ -96,6 +96,12 @@ void ExtensionPrefs::MakePathsRelative() { DictionaryValue* extension_dict; if (!dict->GetDictionaryWithoutPathExpansion(*i, &extension_dict)) continue; + int location_value; + if (extension_dict->GetInteger(kPrefLocation, &location_value) && + location_value == Extension::LOAD) { + // Unpacked extensions can have absolute paths. + continue; + } FilePath::StringType path_string; if (!extension_dict->GetString(kPrefPath, &path_string)) continue; @@ -120,6 +126,12 @@ void ExtensionPrefs::MakePathsAbsolute(DictionaryValue* dict) { NOTREACHED(); continue; } + int location_value; + if (extension_dict->GetInteger(kPrefLocation, &location_value) && + location_value == Extension::LOAD) { + // Unpacked extensions will already have absolute paths. + continue; + } FilePath::StringType path_string; if (!extension_dict->GetString(kPrefPath, &path_string)) { if (!IsBlacklistBitSet(extension_dict)) { @@ -539,11 +551,12 @@ ExtensionPrefs::ExtensionsInfo* ExtensionPrefs::CollectExtensionsInfo( continue; } - // Only internal and external extensions can be installed permanently in the + // Only the following extension types can be installed permanently in the // preferences. Extension::Location location = static_cast<Extension::Location>(location_value); if (location != Extension::INTERNAL && + location != Extension::LOAD && !Extension::IsExternalLocation(location)) { NOTREACHED(); continue; |