diff options
author | atwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-22 01:41:09 +0000 |
---|---|---|
committer | atwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-22 01:41:09 +0000 |
commit | d4a42b3c31aadfa6d87ed11e246c090d2f2d1c45 (patch) | |
tree | 886c7f5c54e4d78a2996b682ce3e33c28da7d019 | |
parent | 789b9dbafa3668508825afe2d47df2fbae3a347f (diff) | |
download | chromium_src-d4a42b3c31aadfa6d87ed11e246c090d2f2d1c45.zip chromium_src-d4a42b3c31aadfa6d87ed11e246c090d2f2d1c45.tar.gz chromium_src-d4a42b3c31aadfa6d87ed11e246c090d2f2d1c45.tar.bz2 |
No longer display background page badge on initial start after upgrade
BUG=64144
TEST=manual (Code relies on Extension, which can't be mocked out)
Review URL: http://codereview.chromium.org/6352010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72253 0039d316-1c4b-4281-b951-d872f2087c98
-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; } } |