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

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

Issue 2586153002: Move kill switch and secure origin checking logic (Closed)
Patch Set: Move kill switch and secure origin checking logic Created 4 years 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 web_contents, requesting_origin, 76 web_contents, requesting_origin,
77 base::Bind(&ProtectedMediaIdentifierPermissionContext:: 77 base::Bind(&ProtectedMediaIdentifierPermissionContext::
78 OnPlatformVerificationConsentResponse, 78 OnPlatformVerificationConsentResponse,
79 weak_factory_.GetWeakPtr(), web_contents, id, 79 weak_factory_.GetWeakPtr(), web_contents, id,
80 requesting_origin, embedding_origin, callback)); 80 requesting_origin, embedding_origin, callback));
81 pending_requests_.insert( 81 pending_requests_.insert(
82 std::make_pair(web_contents, std::make_pair(widget, id))); 82 std::make_pair(web_contents, std::make_pair(widget, id)));
83 } 83 }
84 #endif // defined(OS_CHROMEOS) 84 #endif // defined(OS_CHROMEOS)
85 85
86 ContentSetting ProtectedMediaIdentifierPermissionContext::GetPermissionStatus( 86 ContentSetting
87 const GURL& requesting_origin, 87 ProtectedMediaIdentifierPermissionContext::GetPermissionStatusInternal(
88 const GURL& embedding_origin) const { 88 const GURL& requesting_origin,
89 const GURL& embedding_origin) const {
89 DVLOG(1) << __func__ << ": (" << requesting_origin.spec() << ", " 90 DVLOG(1) << __func__ << ": (" << requesting_origin.spec() << ", "
90 << embedding_origin.spec() << ")"; 91 << embedding_origin.spec() << ")";
91 92
92 if (!requesting_origin.is_valid() || !embedding_origin.is_valid() || 93 if (!requesting_origin.is_valid() || !embedding_origin.is_valid() ||
93 !IsProtectedMediaIdentifierEnabled()) { 94 !IsProtectedMediaIdentifierEnabled()) {
94 return CONTENT_SETTING_BLOCK; 95 return CONTENT_SETTING_BLOCK;
95 } 96 }
96 97
97 ContentSetting content_setting = PermissionContextBase::GetPermissionStatus( 98 ContentSetting content_setting =
98 requesting_origin, embedding_origin); 99 PermissionContextBase::GetPermissionStatusInternal(requesting_origin,
100 embedding_origin);
99 DCHECK(content_setting == CONTENT_SETTING_ALLOW || 101 DCHECK(content_setting == CONTENT_SETTING_ALLOW ||
100 content_setting == CONTENT_SETTING_BLOCK || 102 content_setting == CONTENT_SETTING_BLOCK ||
101 content_setting == CONTENT_SETTING_ASK); 103 content_setting == CONTENT_SETTING_ASK);
102 104
103 return content_setting; 105 return content_setting;
104 } 106 }
105 107
106 void ProtectedMediaIdentifierPermissionContext::CancelPermissionRequest( 108 void ProtectedMediaIdentifierPermissionContext::CancelPermissionRequest(
107 content::WebContents* web_contents, 109 content::WebContents* web_contents,
108 const PermissionRequestID& id) { 110 const PermissionRequestID& id) {
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 content_setting = CONTENT_SETTING_BLOCK; 225 content_setting = CONTENT_SETTING_BLOCK;
224 persist = true; 226 persist = true;
225 break; 227 break;
226 } 228 }
227 229
228 NotifyPermissionSet( 230 NotifyPermissionSet(
229 id, requesting_origin, embedding_origin, callback, 231 id, requesting_origin, embedding_origin, callback,
230 persist, content_setting); 232 persist, content_setting);
231 } 233 }
232 #endif 234 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698