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

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: Addressed review comments, removed blacklist from extension ID list, added unittest. 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
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..68070c68ad3bf1a61d22a58b1313940ca46a1520 100644
--- a/chrome/browser/extensions/extension_prefs.cc
+++ b/chrome/browser/extensions/extension_prefs.cc
@@ -1543,6 +1543,23 @@ void ExtensionPrefs::GetExtensions(ExtensionIdSet* out) {
}
}
+// static
+void ExtensionPrefs::GetExtensionsFrom(
+ const base::DictionaryValue* extension_prefs,
+ ExtensionIdSet* out) {
+ CHECK(out);
+ 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))
+ out->push_back(*it);
+ }
+}
+
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.

Powered by Google App Engine
This is Rietveld 408576698