Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(353)

Side by Side Diff: chrome/browser/notifications/notification_permission_context.cc

Issue 1694923004: Use GURLs instead of patterns in SetContentSetting in notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scoping_set_content_setting
Patch Set: minor change Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/notifications/notification_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/notifications/notification_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698