Index: chrome/browser/extensions/extension_prefs.cc |
diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc |
index 890ba9970794457cd678d4eed6094c107e240ac9..c0252ad9f06f3abdc49616c4cfbbbc3cab73f786 100644 |
--- a/chrome/browser/extensions/extension_prefs.cc |
+++ b/chrome/browser/extensions/extension_prefs.cc |
@@ -699,13 +699,14 @@ void ExtensionPrefs::UpdateBlacklist( |
remove_pref_ids.push_back(id); |
} else { |
// Remove the blacklist bit. |
- ext->Remove(kPrefBlacklist, NULL); |
+ UpdateExtensionPref(id, kPrefBlacklist, NULL); |
} |
} |
} else { |
if (!IsBlacklistBitSet(ext)) { |
// Only set the blacklist if it was not set. |
- ext->SetBoolean(kPrefBlacklist, true); |
+ UpdateExtensionPref(id, kPrefBlacklist, |
+ Value::CreateBooleanValue(true)); |
} |
// Keep the record if this extension is already processed. |
used_id_set.insert(id); |
@@ -1543,6 +1544,23 @@ void ExtensionPrefs::GetExtensions(ExtensionIdSet* out) { |
} |
} |
+// static |
+ExtensionPrefs::ExtensionIdSet ExtensionPrefs::GetExtensionsFrom( |
+ const base::DictionaryValue* extension_prefs) { |
+ ExtensionIdSet result; |
+ for (base::DictionaryValue::key_iterator it = extension_prefs->begin_keys(); |
+ it != extension_prefs->end_keys(); ++it) { |
+ DictionaryValue* ext; |
+ if (!extension_prefs->GetDictionaryWithoutPathExpansion(*it, &ext)) { |
+ NOTREACHED() << "Invalid pref for extension " << *it; |
+ continue; |
+ } |
+ if (!IsBlacklistBitSet(ext)) |
+ result.push_back(*it); |
+ } |
+ return result; |
+} |
+ |
void ExtensionPrefs::FixMissingPrefs(const ExtensionIdSet& extension_ids) { |
// Fix old entries that did not get an installation time entry when they |
// were installed or don't have a preferences field. |