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

Side by Side Diff: chrome/browser/background_sync/background_sync_permission_context.cc

Issue 1726323002: Have Permission{Manager,Service} use Origin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clarify and test Origin.empty_. 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/background_sync/background_sync_permission_context.h" 5 #include "chrome/browser/background_sync/background_sync_permission_context.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "components/content_settings/core/common/content_settings_types.h" 8 #include "components/content_settings/core/common/content_settings_types.h"
9 #include "content/public/browser/permission_type.h" 9 #include "content/public/browser/permission_type.h"
10 10
11 BackgroundSyncPermissionContext::BackgroundSyncPermissionContext( 11 BackgroundSyncPermissionContext::BackgroundSyncPermissionContext(
12 Profile* profile) 12 Profile* profile)
13 : PermissionContextBase(profile, 13 : PermissionContextBase(profile,
14 content::PermissionType::BACKGROUND_SYNC, 14 content::PermissionType::BACKGROUND_SYNC,
15 CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC) {} 15 CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC) {}
16 16
17 void BackgroundSyncPermissionContext::CancelPermissionRequest( 17 void BackgroundSyncPermissionContext::CancelPermissionRequest(
18 content::WebContents* web_contents, 18 content::WebContents* web_contents,
19 const PermissionRequestID& id) { 19 const PermissionRequestID& id) {
20 // Background sync permission requests are resolved instantly without 20 // Background sync permission requests are resolved instantly without
21 // prompting the user, there is no way to cancel them. 21 // prompting the user, there is no way to cancel them.
22 NOTREACHED(); 22 NOTREACHED();
23 } 23 }
24 24
25 void BackgroundSyncPermissionContext::DecidePermission( 25 void BackgroundSyncPermissionContext::DecidePermission(
26 content::WebContents* web_contents, 26 content::WebContents* web_contents,
27 const PermissionRequestID& id, 27 const PermissionRequestID& id,
28 const GURL& requesting_origin, 28 const url::Origin& requesting_origin,
29 const GURL& embedding_origin, 29 const url::Origin& embedding_origin,
30 const BrowserPermissionCallback& callback) { 30 const BrowserPermissionCallback& callback) {
31 // The user should never be prompted to authorize background sync. 31 // The user should never be prompted to authorize background sync.
32 NOTREACHED(); 32 NOTREACHED();
33 } 33 }
34 34
35 bool BackgroundSyncPermissionContext::IsRestrictedToSecureOrigins() const { 35 bool BackgroundSyncPermissionContext::IsRestrictedToSecureOrigins() const {
36 return true; 36 return true;
37 } 37 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698