Commit d4a42b3c authored by atwilson@chromium.org's avatar atwilson@chromium.org

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
parent 789b9dba
...@@ -190,6 +190,10 @@ bool BackgroundPageTracker::UpdateExtensionList() { ...@@ -190,6 +190,10 @@ bool BackgroundPageTracker::UpdateExtensionList() {
PrefService* prefs = GetPrefService(); PrefService* prefs = GetPrefService();
std::set<std::string> keys_to_delete; std::set<std::string> keys_to_delete;
bool pref_modified = false; 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 = DictionaryValue* contents =
prefs->GetMutableDictionary(prefs::kKnownBackgroundPages); prefs->GetMutableDictionary(prefs::kKnownBackgroundPages);
for (DictionaryValue::key_iterator it = contents->begin_keys(); for (DictionaryValue::key_iterator it = contents->begin_keys();
...@@ -221,7 +225,7 @@ bool BackgroundPageTracker::UpdateExtensionList() { ...@@ -221,7 +225,7 @@ bool BackgroundPageTracker::UpdateExtensionList() {
// If we have not seen this extension ID before, add it to our list. // If we have not seen this extension ID before, add it to our list.
if (!contents->HasKey((*iter)->id())) { if (!contents->HasKey((*iter)->id())) {
contents->SetWithoutPathExpansion( contents->SetWithoutPathExpansion(
(*iter)->id(), Value::CreateBooleanValue(false)); (*iter)->id(), Value::CreateBooleanValue(first_launch));
pref_modified = true; pref_modified = true;
} }
} }
...@@ -240,7 +244,7 @@ bool BackgroundPageTracker::UpdateExtensionList() { ...@@ -240,7 +244,7 @@ bool BackgroundPageTracker::UpdateExtensionList() {
background_contents_service->GetParentApplicationId(*iter)); background_contents_service->GetParentApplicationId(*iter));
if (!contents->HasKey(application_id)) { if (!contents->HasKey(application_id)) {
contents->SetWithoutPathExpansion( contents->SetWithoutPathExpansion(
application_id, Value::CreateBooleanValue(false)); application_id, Value::CreateBooleanValue(first_launch));
pref_modified = true; pref_modified = true;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment