OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/notifications/notification_permission_context.h" | 5 #include "chrome/browser/notifications/notification_permission_context.h" |
6 | 6 |
7 #include <deque> | 7 #include <deque> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 task_queue_.front().timer->Reset(); | 152 task_queue_.front().timer->Reset(); |
153 } | 153 } |
154 | 154 |
155 } // namespace | 155 } // namespace |
156 | 156 |
157 DEFINE_WEB_CONTENTS_USER_DATA_KEY(VisibilityTimerTabHelper); | 157 DEFINE_WEB_CONTENTS_USER_DATA_KEY(VisibilityTimerTabHelper); |
158 | 158 |
159 NotificationPermissionContext::NotificationPermissionContext( | 159 NotificationPermissionContext::NotificationPermissionContext( |
160 Profile* profile, | 160 Profile* profile, |
161 ContentSettingsType content_settings_type) | 161 ContentSettingsType content_settings_type) |
162 : PermissionContextBase(profile, content_settings_type), | 162 : PermissionContextBase(profile, |
| 163 content_settings_type, |
| 164 blink::WebFeaturePolicyFeature::kNotFound), |
163 weak_factory_ui_thread_(this) { | 165 weak_factory_ui_thread_(this) { |
164 DCHECK(content_settings_type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS || | 166 DCHECK(content_settings_type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS || |
165 content_settings_type == CONTENT_SETTINGS_TYPE_PUSH_MESSAGING); | 167 content_settings_type == CONTENT_SETTINGS_TYPE_PUSH_MESSAGING); |
166 } | 168 } |
167 | 169 |
168 NotificationPermissionContext::~NotificationPermissionContext() {} | 170 NotificationPermissionContext::~NotificationPermissionContext() {} |
169 | 171 |
170 ContentSetting NotificationPermissionContext::GetPermissionStatusInternal( | 172 ContentSetting NotificationPermissionContext::GetPermissionStatusInternal( |
171 content::RenderFrameHost* render_frame_host, | 173 content::RenderFrameHost* render_frame_host, |
172 const GURL& requesting_origin, | 174 const GURL& requesting_origin, |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 requesting_origin); | 252 requesting_origin); |
251 } else { | 253 } else { |
252 DesktopNotificationProfileUtil::DenyPermission(profile(), | 254 DesktopNotificationProfileUtil::DenyPermission(profile(), |
253 requesting_origin); | 255 requesting_origin); |
254 } | 256 } |
255 } | 257 } |
256 | 258 |
257 bool NotificationPermissionContext::IsRestrictedToSecureOrigins() const { | 259 bool NotificationPermissionContext::IsRestrictedToSecureOrigins() const { |
258 return content_settings_type() == CONTENT_SETTINGS_TYPE_PUSH_MESSAGING; | 260 return content_settings_type() == CONTENT_SETTINGS_TYPE_PUSH_MESSAGING; |
259 } | 261 } |
OLD | NEW |