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

Unified Diff: chrome/browser/services/gcm/push_messaging_application_id.cc

Issue 930083002: Unregister with push service and SW database when permission is lost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ready Created 5 years, 10 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
Index: chrome/browser/services/gcm/push_messaging_application_id.cc
diff --git a/chrome/browser/services/gcm/push_messaging_application_id.cc b/chrome/browser/services/gcm/push_messaging_application_id.cc
index b246b0088ea87d6c0c3c9a5ed73ea1e82953a324..a0830ad7586b6814bcf1edea58ce6fcec4da8b7f 100644
--- a/chrome/browser/services/gcm/push_messaging_application_id.cc
+++ b/chrome/browser/services/gcm/push_messaging_application_id.cc
@@ -91,6 +91,21 @@ PushMessagingApplicationId PushMessagingApplicationId::Get(
return PushMessagingApplicationId();
}
+// static
+std::vector<PushMessagingApplicationId> PushMessagingApplicationId::GetAll(
+ Profile* profile) {
+ std::vector<PushMessagingApplicationId> result;
+
+ const base::DictionaryValue* map =
+ profile->GetPrefs()->GetDictionary(prefs::kPushMessagingApplicationIdMap);
+ for (auto it = base::DictionaryValue::Iterator(*map); !it.IsAtEnd();
+ it.Advance()) {
+ result.push_back(Get(profile, it.key()));
+ }
+
+ return result;
+}
+
void PushMessagingApplicationId::PersistToDisk(Profile* profile) const {
DCHECK(IsValid());

Powered by Google App Engine
This is Rietveld 408576698