OLD | NEW |
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 "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.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/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 // WebContents may have gone away. | 166 // WebContents may have gone away. |
167 TabSpecificContentSettings* content_settings = | 167 TabSpecificContentSettings* content_settings = |
168 TabSpecificContentSettings::Get(id.render_process_id(), | 168 TabSpecificContentSettings::Get(id.render_process_id(), |
169 id.render_view_id()); | 169 id.render_view_id()); |
170 if (content_settings) { | 170 if (content_settings) { |
171 content_settings->OnProtectedMediaIdentifierPermissionSet( | 171 content_settings->OnProtectedMediaIdentifierPermissionSet( |
172 requesting_frame.GetOrigin(), allowed); | 172 requesting_frame.GetOrigin(), allowed); |
173 } | 173 } |
174 } | 174 } |
175 | 175 |
| 176 bool |
| 177 ProtectedMediaIdentifierPermissionContext::IsRestrictedToSecureOrigins() const { |
| 178 return false; |
| 179 } |
| 180 |
176 // TODO(xhwang): We should consolidate the "protected content" related pref | 181 // TODO(xhwang): We should consolidate the "protected content" related pref |
177 // across platforms. | 182 // across platforms. |
178 bool ProtectedMediaIdentifierPermissionContext:: | 183 bool ProtectedMediaIdentifierPermissionContext:: |
179 IsProtectedMediaIdentifierEnabled() const { | 184 IsProtectedMediaIdentifierEnabled() const { |
180 #if defined(OS_CHROMEOS) | 185 #if defined(OS_CHROMEOS) |
181 // Platform verification is not allowed in incognito or guest mode. | 186 // Platform verification is not allowed in incognito or guest mode. |
182 if (profile()->IsOffTheRecord() || profile()->IsGuestSession()) { | 187 if (profile()->IsOffTheRecord() || profile()->IsGuestSession()) { |
183 DVLOG(1) << "Protected media identifier disabled in incognito or guest " | 188 DVLOG(1) << "Protected media identifier disabled in incognito or guest " |
184 "mode."; | 189 "mode."; |
185 return false; | 190 return false; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 content_setting = CONTENT_SETTING_BLOCK; | 251 content_setting = CONTENT_SETTING_BLOCK; |
247 persist = true; | 252 persist = true; |
248 break; | 253 break; |
249 } | 254 } |
250 | 255 |
251 NotifyPermissionSet( | 256 NotifyPermissionSet( |
252 id, requesting_origin, embedding_origin, callback, | 257 id, requesting_origin, embedding_origin, callback, |
253 persist, content_setting); | 258 persist, content_setting); |
254 } | 259 } |
255 #endif | 260 #endif |
OLD | NEW |