| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 } | 158 } |
| 159 | 159 |
| 160 void ProtectedMediaIdentifierPermissionContext::UpdateTabContext( | 160 void ProtectedMediaIdentifierPermissionContext::UpdateTabContext( |
| 161 const PermissionRequestID& id, | 161 const PermissionRequestID& id, |
| 162 const GURL& requesting_frame, | 162 const GURL& requesting_frame, |
| 163 bool allowed) { | 163 bool allowed) { |
| 164 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 164 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 165 | 165 |
| 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::GetForFrame(id.render_process_id(), |
| 169 id.render_view_id()); | 169 id.render_frame_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 | 176 bool |
| 177 ProtectedMediaIdentifierPermissionContext::IsRestrictedToSecureOrigins() const { | 177 ProtectedMediaIdentifierPermissionContext::IsRestrictedToSecureOrigins() const { |
| 178 return false; | 178 return false; |
| 179 } | 179 } |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 content_setting = CONTENT_SETTING_BLOCK; | 251 content_setting = CONTENT_SETTING_BLOCK; |
| 252 persist = true; | 252 persist = true; |
| 253 break; | 253 break; |
| 254 } | 254 } |
| 255 | 255 |
| 256 NotifyPermissionSet( | 256 NotifyPermissionSet( |
| 257 id, requesting_origin, embedding_origin, callback, | 257 id, requesting_origin, embedding_origin, callback, |
| 258 persist, content_setting); | 258 persist, content_setting); |
| 259 } | 259 } |
| 260 #endif | 260 #endif |
| OLD | NEW |