| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <deque> | 8 #include <deque> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 : PermissionContextBase(profile, | 163 : PermissionContextBase(profile, |
| 164 content::PermissionType::NOTIFICATIONS, | 164 content::PermissionType::NOTIFICATIONS, |
| 165 CONTENT_SETTINGS_TYPE_NOTIFICATIONS), | 165 CONTENT_SETTINGS_TYPE_NOTIFICATIONS), |
| 166 weak_factory_ui_thread_(this) {} | 166 weak_factory_ui_thread_(this) {} |
| 167 | 167 |
| 168 NotificationPermissionContext::~NotificationPermissionContext() {} | 168 NotificationPermissionContext::~NotificationPermissionContext() {} |
| 169 | 169 |
| 170 void NotificationPermissionContext::ResetPermission( | 170 void NotificationPermissionContext::ResetPermission( |
| 171 const GURL& requesting_origin, | 171 const GURL& requesting_origin, |
| 172 const GURL& embedder_origin) { | 172 const GURL& embedder_origin) { |
| 173 DesktopNotificationProfileUtil::ClearSetting( | 173 DesktopNotificationProfileUtil::ClearSetting(profile(), requesting_origin); |
| 174 profile(), ContentSettingsPattern::FromURLNoWildcard(requesting_origin)); | |
| 175 } | 174 } |
| 176 | 175 |
| 177 void NotificationPermissionContext::CancelPermissionRequest( | 176 void NotificationPermissionContext::CancelPermissionRequest( |
| 178 content::WebContents* web_contents, | 177 content::WebContents* web_contents, |
| 179 const PermissionRequestID& id) { | 178 const PermissionRequestID& id) { |
| 180 if (profile()->IsOffTheRecord()) { | 179 if (profile()->IsOffTheRecord()) { |
| 181 VisibilityTimerTabHelper::FromWebContents(web_contents)->CancelTask(id); | 180 VisibilityTimerTabHelper::FromWebContents(web_contents)->CancelTask(id); |
| 182 } else { | 181 } else { |
| 183 PermissionContextBase::CancelPermissionRequest(web_contents, id); | 182 PermissionContextBase::CancelPermissionRequest(web_contents, id); |
| 184 } | 183 } |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 requesting_origin); | 234 requesting_origin); |
| 236 } else { | 235 } else { |
| 237 DesktopNotificationProfileUtil::DenyPermission(profile(), | 236 DesktopNotificationProfileUtil::DenyPermission(profile(), |
| 238 requesting_origin); | 237 requesting_origin); |
| 239 } | 238 } |
| 240 } | 239 } |
| 241 | 240 |
| 242 bool NotificationPermissionContext::IsRestrictedToSecureOrigins() const { | 241 bool NotificationPermissionContext::IsRestrictedToSecureOrigins() const { |
| 243 return false; | 242 return false; |
| 244 } | 243 } |
| OLD | NEW |