diff options
Diffstat (limited to 'chrome/browser/background_page_tracker.cc')
-rw-r--r-- | chrome/browser/background_page_tracker.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/chrome/browser/background_page_tracker.cc b/chrome/browser/background_page_tracker.cc index 76cc63a..1337d90 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; } } |