| 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/metrics/user_metrics.h" |
| 8 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 9 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 10 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 10 #include "chrome/browser/permissions/permission_util.h" | 11 #include "chrome/browser/permissions/permission_util.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/common/pref_names.h" | 13 #include "chrome/common/pref_names.h" |
| 13 #include "components/prefs/pref_service.h" | 14 #include "components/prefs/pref_service.h" |
| 14 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
| 15 #include "content/public/browser/render_frame_host.h" | 16 #include "content/public/browser/render_frame_host.h" |
| 16 #include "content/public/browser/user_metrics.h" | |
| 17 #include "content/public/browser/web_contents.h" | 17 #include "content/public/browser/web_contents.h" |
| 18 #if defined(OS_CHROMEOS) | 18 #if defined(OS_CHROMEOS) |
| 19 #include <utility> | 19 #include <utility> |
| 20 | 20 |
| 21 #include "chrome/browser/chromeos/attestation/platform_verification_dialog.h" | 21 #include "chrome/browser/chromeos/attestation/platform_verification_dialog.h" |
| 22 #include "chrome/browser/chromeos/settings/cros_settings.h" | 22 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 23 #include "chromeos/chromeos_switches.h" | 23 #include "chromeos/chromeos_switches.h" |
| 24 #include "chromeos/settings/cros_settings_names.h" | 24 #include "chromeos/settings/cros_settings_names.h" |
| 25 #include "components/pref_registry/pref_registry_syncable.h" | 25 #include "components/pref_registry/pref_registry_syncable.h" |
| 26 #include "components/user_prefs/user_prefs.h" | 26 #include "components/user_prefs/user_prefs.h" |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 ContentSetting content_setting = CONTENT_SETTING_ASK; | 205 ContentSetting content_setting = CONTENT_SETTING_ASK; |
| 206 bool persist = false; // Whether the ContentSetting should be saved. | 206 bool persist = false; // Whether the ContentSetting should be saved. |
| 207 switch (response) { | 207 switch (response) { |
| 208 case PlatformVerificationDialog::CONSENT_RESPONSE_NONE: | 208 case PlatformVerificationDialog::CONSENT_RESPONSE_NONE: |
| 209 VLOG(1) << "Platform verification dismissed by user."; | 209 VLOG(1) << "Platform verification dismissed by user."; |
| 210 content_setting = CONTENT_SETTING_ASK; | 210 content_setting = CONTENT_SETTING_ASK; |
| 211 persist = false; | 211 persist = false; |
| 212 break; | 212 break; |
| 213 case PlatformVerificationDialog::CONSENT_RESPONSE_ALLOW: | 213 case PlatformVerificationDialog::CONSENT_RESPONSE_ALLOW: |
| 214 VLOG(1) << "Platform verification accepted by user."; | 214 VLOG(1) << "Platform verification accepted by user."; |
| 215 content::RecordAction( | 215 base::RecordAction( |
| 216 base::UserMetricsAction("PlatformVerificationAccepted")); | 216 base::UserMetricsAction("PlatformVerificationAccepted")); |
| 217 content_setting = CONTENT_SETTING_ALLOW; | 217 content_setting = CONTENT_SETTING_ALLOW; |
| 218 persist = true; | 218 persist = true; |
| 219 break; | 219 break; |
| 220 case PlatformVerificationDialog::CONSENT_RESPONSE_DENY: | 220 case PlatformVerificationDialog::CONSENT_RESPONSE_DENY: |
| 221 VLOG(1) << "Platform verification denied by user."; | 221 VLOG(1) << "Platform verification denied by user."; |
| 222 content::RecordAction( | 222 base::RecordAction( |
| 223 base::UserMetricsAction("PlatformVerificationRejected")); | 223 base::UserMetricsAction("PlatformVerificationRejected")); |
| 224 content_setting = CONTENT_SETTING_BLOCK; | 224 content_setting = CONTENT_SETTING_BLOCK; |
| 225 persist = true; | 225 persist = true; |
| 226 break; | 226 break; |
| 227 } | 227 } |
| 228 | 228 |
| 229 NotifyPermissionSet( | 229 NotifyPermissionSet( |
| 230 id, requesting_origin, embedding_origin, callback, | 230 id, requesting_origin, embedding_origin, callback, |
| 231 persist, content_setting); | 231 persist, content_setting); |
| 232 } | 232 } |
| 233 #endif | 233 #endif |
| OLD | NEW |