| 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/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 const BrowserPermissionCallback& callback, | 176 const BrowserPermissionCallback& callback, |
| 177 chromeos::attestation::PlatformVerificationFlow::ConsentResponse response) { | 177 chromeos::attestation::PlatformVerificationFlow::ConsentResponse response) { |
| 178 // The request may have been canceled. Drop the callback in that case. | 178 // The request may have been canceled. Drop the callback in that case. |
| 179 PendingRequestMap::iterator request = pending_requests_.find(web_contents); | 179 PendingRequestMap::iterator request = pending_requests_.find(web_contents); |
| 180 if (request == pending_requests_.end()) | 180 if (request == pending_requests_.end()) |
| 181 return; | 181 return; |
| 182 | 182 |
| 183 DCHECK(request->second.second.Equals(id)); | 183 DCHECK(request->second.second.Equals(id)); |
| 184 pending_requests_.erase(request); | 184 pending_requests_.erase(request); |
| 185 | 185 |
| 186 ContentSetting content_setting; | 186 ContentSetting content_setting = CONTENT_SETTING_DEFAULT; |
| 187 bool persist; // Whether the ContentSetting should be saved. | 187 bool persist = false; // Whether the ContentSetting should be saved. |
| 188 switch (response) { | 188 switch (response) { |
| 189 case PlatformVerificationFlow::CONSENT_RESPONSE_NONE: | 189 case PlatformVerificationFlow::CONSENT_RESPONSE_NONE: |
| 190 content_setting = CONTENT_SETTING_DEFAULT; | 190 content_setting = CONTENT_SETTING_DEFAULT; |
| 191 persist = false; | 191 persist = false; |
| 192 break; | 192 break; |
| 193 case PlatformVerificationFlow::CONSENT_RESPONSE_ALLOW: | 193 case PlatformVerificationFlow::CONSENT_RESPONSE_ALLOW: |
| 194 content_setting = CONTENT_SETTING_ALLOW; | 194 content_setting = CONTENT_SETTING_ALLOW; |
| 195 persist = true; | 195 persist = true; |
| 196 break; | 196 break; |
| 197 case PlatformVerificationFlow::CONSENT_RESPONSE_DENY: | 197 case PlatformVerificationFlow::CONSENT_RESPONSE_DENY: |
| 198 content_setting = CONTENT_SETTING_BLOCK; | 198 content_setting = CONTENT_SETTING_BLOCK; |
| 199 persist = true; | 199 persist = true; |
| 200 break; | 200 break; |
| 201 } | 201 } |
| 202 | 202 |
| 203 NotifyPermissionSet( | 203 NotifyPermissionSet( |
| 204 id, requesting_origin, embedding_origin, callback, | 204 id, requesting_origin, embedding_origin, callback, |
| 205 persist, content_setting); | 205 persist, content_setting); |
| 206 } | 206 } |
| 207 #endif | 207 #endif |
| OLD | NEW |