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

Unified Diff: chrome/browser/background_page_tracker.cc

Issue 6352010: No longer display background page badge on initial start after upgrade (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698