OLD | NEW |
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" | |
10 | 9 |
11 BackgroundSyncPermissionContext::BackgroundSyncPermissionContext( | 10 BackgroundSyncPermissionContext::BackgroundSyncPermissionContext( |
12 Profile* profile) | 11 Profile* profile) |
13 : PermissionContextBase(profile, | 12 : PermissionContextBase(profile, |
14 content::PermissionType::BACKGROUND_SYNC, | |
15 CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC) {} | 13 CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC) {} |
16 | 14 |
17 void BackgroundSyncPermissionContext::CancelPermissionRequest( | 15 void BackgroundSyncPermissionContext::CancelPermissionRequest( |
18 content::WebContents* web_contents, | 16 content::WebContents* web_contents, |
19 const PermissionRequestID& id) { | 17 const PermissionRequestID& id) { |
20 // Background sync permission requests are resolved instantly without | 18 // Background sync permission requests are resolved instantly without |
21 // prompting the user, there is no way to cancel them. | 19 // prompting the user, there is no way to cancel them. |
22 NOTREACHED(); | 20 NOTREACHED(); |
23 } | 21 } |
24 | 22 |
25 void BackgroundSyncPermissionContext::DecidePermission( | 23 void BackgroundSyncPermissionContext::DecidePermission( |
26 content::WebContents* web_contents, | 24 content::WebContents* web_contents, |
27 const PermissionRequestID& id, | 25 const PermissionRequestID& id, |
28 const GURL& requesting_origin, | 26 const GURL& requesting_origin, |
29 const GURL& embedding_origin, | 27 const GURL& embedding_origin, |
30 bool user_gesture, | 28 bool user_gesture, |
31 const BrowserPermissionCallback& callback) { | 29 const BrowserPermissionCallback& callback) { |
32 // The user should never be prompted to authorize background sync. | 30 // The user should never be prompted to authorize background sync. |
33 NOTREACHED(); | 31 NOTREACHED(); |
34 } | 32 } |
35 | 33 |
36 bool BackgroundSyncPermissionContext::IsRestrictedToSecureOrigins() const { | 34 bool BackgroundSyncPermissionContext::IsRestrictedToSecureOrigins() const { |
37 return true; | 35 return true; |
38 } | 36 } |
OLD | NEW |