Chromium Code Reviews| 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; |