| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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, |
| 121 profile_); | 121 PROMPT, profile_); |
| 122 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, | 122 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, |
| 123 true /* persist */, CONTENT_SETTING_BLOCK); | 123 true /* persist */, CONTENT_SETTING_BLOCK); |
| 124 return; | 124 return; |
| 125 } | 125 } |
| 126 | 126 |
| 127 if (notification_status == blink::mojom::PermissionStatus::DENIED) { | 127 if (notification_status == blink::mojom::PermissionStatus::DENIED) { |
| 128 DVLOG(1) << "Notification permission has not been granted."; | 128 DVLOG(1) << "Notification permission has not been granted."; |
| 129 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, | 129 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, |
| 130 false /* persist */, CONTENT_SETTING_BLOCK); | 130 false /* persist */, CONTENT_SETTING_BLOCK); |
| 131 return; | 131 return; |
| 132 } | 132 } |
| 133 | 133 |
| 134 PermissionUmaUtil::PermissionGranted(permission_type(), requesting_origin, | 134 PermissionUmaUtil::PermissionGranted(permission_type(), requesting_origin, |
| 135 profile_); | 135 PROMPT, profile_); |
| 136 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, | 136 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, |
| 137 true /* persist */, CONTENT_SETTING_ALLOW); | 137 true /* persist */, CONTENT_SETTING_ALLOW); |
| 138 } | 138 } |
| OLD | NEW |