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

Unified Diff: chrome/browser/push_messaging/push_messaging_permission_context.cc

Issue 1816123002: Add testing for subscription from service workers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review comments incorporated and all tests working Created 4 years, 9 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/push_messaging/push_messaging_permission_context.cc
diff --git a/chrome/browser/push_messaging/push_messaging_permission_context.cc b/chrome/browser/push_messaging/push_messaging_permission_context.cc
index 6125f3ebfd3ab245f66518fa08ef6a867994c06e..3ee84195e71ce2e1dd8ce552624f565629ee5d5e 100644
--- a/chrome/browser/push_messaging/push_messaging_permission_context.cc
+++ b/chrome/browser/push_messaging/push_messaging_permission_context.cc
@@ -53,12 +53,13 @@ ContentSetting PushMessagingPermissionContext::GetPermissionStatus(
push_content_setting == CONTENT_SETTING_BLOCK) {
return CONTENT_SETTING_BLOCK;
}
- if (notifications_permission == CONTENT_SETTING_ASK ||
- push_content_setting == CONTENT_SETTING_ASK) {
Michael van Ouwerkerk 2016/03/30 09:50:04 Does this change any of our current behavior?
harkness 2016/03/30 10:51:49 This makes the current behavior for registering fr
+ // If the notifications permission has already been granted,
+ // grant the push messaging permission.
+ if (notifications_permission == CONTENT_SETTING_ASK)
return CONTENT_SETTING_ASK;
- }
- DCHECK_EQ(CONTENT_SETTING_ALLOW, notifications_permission);
- DCHECK_EQ(CONTENT_SETTING_ALLOW, push_content_setting);
+
+ DCHECK(push_content_setting == CONTENT_SETTING_ALLOW ||
+ push_content_setting == CONTENT_SETTING_ASK);
return CONTENT_SETTING_ALLOW;
#else
return CONTENT_SETTING_BLOCK;

Powered by Google App Engine
This is Rietveld 408576698