Index: chrome/browser/background_page_tracker.cc |
diff --git a/chrome/browser/background_page_tracker.cc b/chrome/browser/background_page_tracker.cc |
index 76cc63af38147985639959850756733295c7f6c3..1337d908d21263f0d594577fbcedb96a0ab3a8cc 100644 |
--- a/chrome/browser/background_page_tracker.cc |
+++ b/chrome/browser/background_page_tracker.cc |
@@ -190,6 +190,10 @@ bool BackgroundPageTracker::UpdateExtensionList() { |
PrefService* prefs = GetPrefService(); |
std::set<std::string> keys_to_delete; |
bool pref_modified = false; |
+ // If we've never set any prefs, then this is the first launch ever, so we |
+ // want to automatically mark all existing extensions as acknowledged. |
+ bool first_launch = |
+ prefs->GetDictionary(prefs::kKnownBackgroundPages) == NULL; |
DictionaryValue* contents = |
prefs->GetMutableDictionary(prefs::kKnownBackgroundPages); |
for (DictionaryValue::key_iterator it = contents->begin_keys(); |
@@ -221,7 +225,7 @@ bool BackgroundPageTracker::UpdateExtensionList() { |
// If we have not seen this extension ID before, add it to our list. |
if (!contents->HasKey((*iter)->id())) { |
contents->SetWithoutPathExpansion( |
- (*iter)->id(), Value::CreateBooleanValue(false)); |
+ (*iter)->id(), Value::CreateBooleanValue(first_launch)); |
pref_modified = true; |
} |
} |
@@ -240,7 +244,7 @@ bool BackgroundPageTracker::UpdateExtensionList() { |
background_contents_service->GetParentApplicationId(*iter)); |
if (!contents->HasKey(application_id)) { |
contents->SetWithoutPathExpansion( |
- application_id, Value::CreateBooleanValue(false)); |
+ application_id, Value::CreateBooleanValue(first_launch)); |
pref_modified = true; |
} |
} |