| 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 "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" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/common/pref_names.h" | 12 #include "chrome/common/pref_names.h" |
| 13 #include "components/prefs/pref_service.h" | 13 #include "components/prefs/pref_service.h" |
| 14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
| 15 #include "content/public/browser/permission_type.h" | |
| 16 #include "content/public/browser/render_frame_host.h" | 15 #include "content/public/browser/render_frame_host.h" |
| 17 #include "content/public/browser/user_metrics.h" | 16 #include "content/public/browser/user_metrics.h" |
| 18 #include "content/public/browser/web_contents.h" | 17 #include "content/public/browser/web_contents.h" |
| 19 #if defined(OS_CHROMEOS) | 18 #if defined(OS_CHROMEOS) |
| 20 #include <utility> | 19 #include <utility> |
| 21 | 20 |
| 22 #include "chrome/browser/chromeos/attestation/platform_verification_dialog.h" | 21 #include "chrome/browser/chromeos/attestation/platform_verification_dialog.h" |
| 23 #include "chrome/browser/chromeos/settings/cros_settings.h" | 22 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 24 #include "chromeos/chromeos_switches.h" | 23 #include "chromeos/chromeos_switches.h" |
| 25 #include "chromeos/settings/cros_settings_names.h" | 24 #include "chromeos/settings/cros_settings_names.h" |
| 26 #include "components/pref_registry/pref_registry_syncable.h" | 25 #include "components/pref_registry/pref_registry_syncable.h" |
| 27 #include "components/user_prefs/user_prefs.h" | 26 #include "components/user_prefs/user_prefs.h" |
| 28 #include "ui/views/widget/widget.h" | 27 #include "ui/views/widget/widget.h" |
| 29 #elif !defined(OS_ANDROID) | 28 #elif !defined(OS_ANDROID) |
| 30 #error This file currently only supports Chrome OS and Android. | 29 #error This file currently only supports Chrome OS and Android. |
| 31 #endif | 30 #endif |
| 32 | 31 |
| 33 #if defined(OS_CHROMEOS) | 32 #if defined(OS_CHROMEOS) |
| 34 using chromeos::attestation::PlatformVerificationDialog; | 33 using chromeos::attestation::PlatformVerificationDialog; |
| 35 #endif | 34 #endif |
| 36 | 35 |
| 37 ProtectedMediaIdentifierPermissionContext:: | 36 ProtectedMediaIdentifierPermissionContext:: |
| 38 ProtectedMediaIdentifierPermissionContext(Profile* profile) | 37 ProtectedMediaIdentifierPermissionContext(Profile* profile) |
| 39 : PermissionContextBase(profile, | 38 : PermissionContextBase(profile, |
| 40 content::PermissionType::PROTECTED_MEDIA_IDENTIFIER, | |
| 41 CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER) | 39 CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER) |
| 42 #if defined(OS_CHROMEOS) | 40 #if defined(OS_CHROMEOS) |
| 43 , | 41 , |
| 44 weak_factory_(this) | 42 weak_factory_(this) |
| 45 #endif | 43 #endif |
| 46 { | 44 { |
| 47 } | 45 } |
| 48 | 46 |
| 49 ProtectedMediaIdentifierPermissionContext:: | 47 ProtectedMediaIdentifierPermissionContext:: |
| 50 ~ProtectedMediaIdentifierPermissionContext() { | 48 ~ProtectedMediaIdentifierPermissionContext() { |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 content_setting = CONTENT_SETTING_BLOCK; | 223 content_setting = CONTENT_SETTING_BLOCK; |
| 226 persist = true; | 224 persist = true; |
| 227 break; | 225 break; |
| 228 } | 226 } |
| 229 | 227 |
| 230 NotifyPermissionSet( | 228 NotifyPermissionSet( |
| 231 id, requesting_origin, embedding_origin, callback, | 229 id, requesting_origin, embedding_origin, callback, |
| 232 persist, content_setting); | 230 persist, content_setting); |
| 233 } | 231 } |
| 234 #endif | 232 #endif |
| OLD | NEW |