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

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

Issue 23581015: Reland r223124: Don't clear existing extension-defined preferences and content settings when reload… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 years, 3 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_pref_value_map.cc
diff --git a/chrome/browser/extensions/extension_pref_value_map.cc b/chrome/browser/extensions/extension_pref_value_map.cc
index c497e5ad1cb65d29cb1dee8bdf09f1c1094fe1e1..d8521e56aafe48e7ef3df8e4a9941c604cc4f81d 100644
--- a/chrome/browser/extensions/extension_pref_value_map.cc
+++ b/chrome/browser/extensions/extension_pref_value_map.cc
@@ -116,10 +116,13 @@ bool ExtensionPrefValueMap::DoesExtensionControlPref(
void ExtensionPrefValueMap::RegisterExtension(const std::string& ext_id,
const base::Time& install_time,
bool is_enabled) {
- if (entries_.find(ext_id) != entries_.end())
- UnregisterExtension(ext_id);
- entries_[ext_id] = new ExtensionEntry;
- entries_[ext_id]->install_time = install_time;
+ if (entries_.find(ext_id) == entries_.end()) {
+ entries_[ext_id] = new ExtensionEntry;
+
+ // Only update the install time if the extension is newly installed.
+ entries_[ext_id]->install_time = install_time;
+ }
+
entries_[ext_id]->enabled = is_enabled;
}
« no previous file with comments | « chrome/browser/extensions/api/preference/preference_apitest.cc ('k') | chrome/browser/extensions/extension_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698