Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/push_messaging/push_messaging_permission_context.h" | 5 #include "chrome/browser/push_messaging/push_messaging_permission_context.h" |
| 6 | 6 |
| 7 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 7 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
| 8 #include "chrome/browser/permissions/permission_manager.h" | 8 #include "chrome/browser/permissions/permission_manager.h" |
| 9 #include "chrome/browser/permissions/permission_request_id.h" | 9 #include "chrome/browser/permissions/permission_request_id.h" |
| 10 #include "chrome/browser/permissions/permission_uma_util.h" | 10 #include "chrome/browser/permissions/permission_uma_util.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 110 DCHECK_NE(notification_status, blink::mojom::PermissionStatus::ASK); | 110 DCHECK_NE(notification_status, blink::mojom::PermissionStatus::ASK); |
| 111 | 111 |
| 112 ContentSetting push_content_setting = | 112 ContentSetting push_content_setting = |
| 113 HostContentSettingsMapFactory::GetForProfile(profile_) | 113 HostContentSettingsMapFactory::GetForProfile(profile_) |
| 114 ->GetContentSettingAndMaybeUpdateLastUsage( | 114 ->GetContentSettingAndMaybeUpdateLastUsage( |
| 115 requesting_origin, embedding_origin, content_settings_type(), | 115 requesting_origin, embedding_origin, content_settings_type(), |
| 116 std::string()); | 116 std::string()); |
| 117 | 117 |
| 118 if (push_content_setting == CONTENT_SETTING_BLOCK) { | 118 if (push_content_setting == CONTENT_SETTING_BLOCK) { |
| 119 DVLOG(1) << "Push permission was explicitly blocked."; | 119 DVLOG(1) << "Push permission was explicitly blocked."; |
| 120 PermissionUmaUtil::PermissionDenied(permission_type(), requesting_origin); | 120 PermissionUmaUtil::PermissionDenied(permission_type(), requesting_origin, |
|
kcarattini
2016/06/24 03:48:57
As we discussed, can you double check and then add
raymes
2016/06/27 04:36:17
Stefano and I are looking into this. It's a bit ha
kcarattini
2016/06/30 02:53:11
Ok, has there been a bug filed for this? I didn't
| |
| 121 profile_); | |
| 121 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, | 122 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, |
| 122 true /* persist */, CONTENT_SETTING_BLOCK); | 123 true /* persist */, CONTENT_SETTING_BLOCK); |
| 123 return; | 124 return; |
| 124 } | 125 } |
| 125 | 126 |
| 126 if (notification_status == blink::mojom::PermissionStatus::DENIED) { | 127 if (notification_status == blink::mojom::PermissionStatus::DENIED) { |
| 127 DVLOG(1) << "Notification permission has not been granted."; | 128 DVLOG(1) << "Notification permission has not been granted."; |
| 128 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, | 129 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, |
| 129 false /* persist */, CONTENT_SETTING_BLOCK); | 130 false /* persist */, CONTENT_SETTING_BLOCK); |
| 130 return; | 131 return; |
| 131 } | 132 } |
| 132 | 133 |
| 133 PermissionUmaUtil::PermissionGranted(permission_type(), requesting_origin); | 134 PermissionUmaUtil::PermissionGranted(permission_type(), requesting_origin, |
| 135 profile_); | |
| 134 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, | 136 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, |
| 135 true /* persist */, CONTENT_SETTING_ALLOW); | 137 true /* persist */, CONTENT_SETTING_ALLOW); |
| 136 } | 138 } |
| OLD | NEW |