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

Side by Side Diff: chrome/browser/storage/durable_storage_permission_context.cc

Issue 2908133003: Split GetPermissionStatus into GetPermissionStatusForFrame/Worker
Patch Set: Split GetPermissionStatus into GetPermissionStatusForFrame/Worker Created 3 years, 6 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/storage/durable_storage_permission_context.h" 5 #include "chrome/browser/storage/durable_storage_permission_context.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
(...skipping 13 matching lines...) Expand all
24 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" 24 #include "net/base/registry_controlled_domains/registry_controlled_domain.h"
25 #include "url/gurl.h" 25 #include "url/gurl.h"
26 26
27 using bookmarks::BookmarkModel; 27 using bookmarks::BookmarkModel;
28 28
29 DurableStoragePermissionContext::DurableStoragePermissionContext( 29 DurableStoragePermissionContext::DurableStoragePermissionContext(
30 Profile* profile) 30 Profile* profile)
31 : PermissionContextBase(profile, 31 : PermissionContextBase(profile,
32 CONTENT_SETTINGS_TYPE_DURABLE_STORAGE) {} 32 CONTENT_SETTINGS_TYPE_DURABLE_STORAGE) {}
33 33
34 bool DurableStoragePermissionContext::IsAllowedInWorkers() const {
35 return true;
36 }
37
34 void DurableStoragePermissionContext::DecidePermission( 38 void DurableStoragePermissionContext::DecidePermission(
35 content::WebContents* web_contents, 39 content::WebContents* web_contents,
36 const PermissionRequestID& id, 40 const PermissionRequestID& id,
37 const GURL& requesting_origin, 41 const GURL& requesting_origin,
38 const GURL& embedding_origin, 42 const GURL& embedding_origin,
39 bool user_gesture, 43 bool user_gesture,
40 const BrowserPermissionCallback& callback) { 44 const BrowserPermissionCallback& callback) {
41 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 45 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
42 DCHECK_NE(CONTENT_SETTING_ALLOW, 46 DCHECK_NE(CONTENT_SETTING_ALLOW,
43 GetPermissionStatus(nullptr /* render_frame_host */, 47 GetPermissionStatus(nullptr /* render_frame_host */,
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 105
102 HostContentSettingsMapFactory::GetForProfile(profile()) 106 HostContentSettingsMapFactory::GetForProfile(profile())
103 ->SetContentSettingDefaultScope(requesting_origin, GURL(), 107 ->SetContentSettingDefaultScope(requesting_origin, GURL(),
104 CONTENT_SETTINGS_TYPE_DURABLE_STORAGE, 108 CONTENT_SETTINGS_TYPE_DURABLE_STORAGE,
105 std::string(), content_setting); 109 std::string(), content_setting);
106 } 110 }
107 111
108 bool DurableStoragePermissionContext::IsRestrictedToSecureOrigins() const { 112 bool DurableStoragePermissionContext::IsRestrictedToSecureOrigins() const {
109 return true; 113 return true;
110 } 114 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698