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

Side by Side Diff: chrome/browser/media/protected_media_identifier_permission_context.cc

Issue 2723983004: Add PermissionManager::GetPermissionStatusForFrame function (Closed)
Patch Set: Add PermissionManager::GetPermissionStatusForFrame function Created 3 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 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/media/protected_media_identifier_permission_context.h" 5 #include "chrome/browser/media/protected_media_identifier_permission_context.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 9 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
10 #include "chrome/browser/permissions/permission_util.h" 10 #include "chrome/browser/permissions/permission_util.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 OnPlatformVerificationConsentResponse, 76 OnPlatformVerificationConsentResponse,
77 weak_factory_.GetWeakPtr(), web_contents, id, 77 weak_factory_.GetWeakPtr(), web_contents, id,
78 requesting_origin, embedding_origin, callback)); 78 requesting_origin, embedding_origin, callback));
79 pending_requests_.insert( 79 pending_requests_.insert(
80 std::make_pair(web_contents, std::make_pair(widget, id))); 80 std::make_pair(web_contents, std::make_pair(widget, id)));
81 } 81 }
82 #endif // defined(OS_CHROMEOS) 82 #endif // defined(OS_CHROMEOS)
83 83
84 ContentSetting 84 ContentSetting
85 ProtectedMediaIdentifierPermissionContext::GetPermissionStatusInternal( 85 ProtectedMediaIdentifierPermissionContext::GetPermissionStatusInternal(
86 content::RenderFrameHost* render_frame_host,
86 const GURL& requesting_origin, 87 const GURL& requesting_origin,
87 const GURL& embedding_origin) const { 88 const GURL& embedding_origin) const {
88 DVLOG(1) << __func__ << ": (" << requesting_origin.spec() << ", " 89 DVLOG(1) << __func__ << ": (" << requesting_origin.spec() << ", "
89 << embedding_origin.spec() << ")"; 90 << embedding_origin.spec() << ")";
90 91
91 if (!requesting_origin.is_valid() || !embedding_origin.is_valid() || 92 if (!requesting_origin.is_valid() || !embedding_origin.is_valid() ||
92 !IsProtectedMediaIdentifierEnabled()) { 93 !IsProtectedMediaIdentifierEnabled()) {
93 return CONTENT_SETTING_BLOCK; 94 return CONTENT_SETTING_BLOCK;
94 } 95 }
95 96
96 ContentSetting content_setting = 97 ContentSetting content_setting =
97 PermissionContextBase::GetPermissionStatusInternal(requesting_origin, 98 PermissionContextBase::GetPermissionStatusInternal(
98 embedding_origin); 99 render_frame_host, requesting_origin, embedding_origin);
99 DCHECK(content_setting == CONTENT_SETTING_ALLOW || 100 DCHECK(content_setting == CONTENT_SETTING_ALLOW ||
100 content_setting == CONTENT_SETTING_BLOCK || 101 content_setting == CONTENT_SETTING_BLOCK ||
101 content_setting == CONTENT_SETTING_ASK); 102 content_setting == CONTENT_SETTING_ASK);
102 103
103 return content_setting; 104 return content_setting;
104 } 105 }
105 106
106 void ProtectedMediaIdentifierPermissionContext::CancelPermissionRequest( 107 void ProtectedMediaIdentifierPermissionContext::CancelPermissionRequest(
107 content::WebContents* web_contents, 108 content::WebContents* web_contents,
108 const PermissionRequestID& id) { 109 const PermissionRequestID& id) {
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 content_setting = CONTENT_SETTING_BLOCK; 224 content_setting = CONTENT_SETTING_BLOCK;
224 persist = true; 225 persist = true;
225 break; 226 break;
226 } 227 }
227 228
228 NotifyPermissionSet( 229 NotifyPermissionSet(
229 id, requesting_origin, embedding_origin, callback, 230 id, requesting_origin, embedding_origin, callback,
230 persist, content_setting); 231 persist, content_setting);
231 } 232 }
232 #endif 233 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698