Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1580)

Unified Diff: chrome/browser/extensions/extension_prefs.cc

Issue 9620010: Added Protector backup for Preferences. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reupload Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/extension_prefs.h ('k') | chrome/browser/prefs/pref_set_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « chrome/browser/extensions/extension_prefs.h ('k') | chrome/browser/prefs/pref_set_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698