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

Unified Diff: chrome/browser/media/protected_media_identifier_permission_context.cc

Issue 2945243002: Permissions: Allow PermissionManager to return more PermissionStatusSources.
Patch Set: Cleanup. 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media/protected_media_identifier_permission_context.cc
diff --git a/chrome/browser/media/protected_media_identifier_permission_context.cc b/chrome/browser/media/protected_media_identifier_permission_context.cc
index a6bf43e955b883d4119ebcc1c88a629fe72d4d94..9a724368e430cc73e84533efa3832dad964c8f87 100644
--- a/chrome/browser/media/protected_media_identifier_permission_context.cc
+++ b/chrome/browser/media/protected_media_identifier_permission_context.cc
@@ -95,7 +95,7 @@ void ProtectedMediaIdentifierPermissionContext::DecidePermission(
}
#endif // defined(OS_CHROMEOS)
-ContentSetting
+PermissionResult
ProtectedMediaIdentifierPermissionContext::GetPermissionStatusInternal(
content::RenderFrameHost* render_frame_host,
const GURL& requesting_origin,
@@ -105,25 +105,26 @@ ProtectedMediaIdentifierPermissionContext::GetPermissionStatusInternal(
if (!requesting_origin.is_valid() || !embedding_origin.is_valid() ||
!IsProtectedMediaIdentifierEnabled()) {
- return CONTENT_SETTING_BLOCK;
+ return PermissionResult(CONTENT_SETTING_BLOCK,
+ PermissionStatusSource::UNSPECIFIED);
}
- ContentSetting content_setting =
- PermissionContextBase::GetPermissionStatusInternal(
- render_frame_host, requesting_origin, embedding_origin);
- DCHECK(content_setting == CONTENT_SETTING_ALLOW ||
- content_setting == CONTENT_SETTING_BLOCK ||
- content_setting == CONTENT_SETTING_ASK);
+ PermissionResult result = PermissionContextBase::GetPermissionStatusInternal(
+ render_frame_host, requesting_origin, embedding_origin);
+ DCHECK(result.content_setting == CONTENT_SETTING_ALLOW ||
+ result.content_setting == CONTENT_SETTING_BLOCK ||
+ result.content_setting == CONTENT_SETTING_ASK);
// For automated testing of protected content - having a prompt that
// requires user intervention is problematic. If the domain has been
// whitelisted as safe - suppress the request and allow.
- if (content_setting == CONTENT_SETTING_ASK &&
+ if (result.content_setting == CONTENT_SETTING_ASK &&
IsOriginWhitelisted(requesting_origin)) {
- content_setting = CONTENT_SETTING_ALLOW;
+ result.content_setting = CONTENT_SETTING_ALLOW;
+ result.source = PermissionStatusSource::ENTERPRISE_POLICY;
}
- return content_setting;
+ return result;
}
bool ProtectedMediaIdentifierPermissionContext::IsOriginWhitelisted(

Powered by Google App Engine
This is Rietveld 408576698