OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/profiles/profile_impl.h" | 5 #include "chrome/browser/profiles/profile_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 #include "content/public/browser/notification_service.h" | 92 #include "content/public/browser/notification_service.h" |
93 #include "content/public/browser/render_process_host.h" | 93 #include "content/public/browser/render_process_host.h" |
94 #include "content/public/browser/storage_partition.h" | 94 #include "content/public/browser/storage_partition.h" |
95 #include "content/public/browser/user_metrics.h" | 95 #include "content/public/browser/user_metrics.h" |
96 #include "content/public/common/content_constants.h" | 96 #include "content/public/common/content_constants.h" |
97 #include "grit/browser_resources.h" | 97 #include "grit/browser_resources.h" |
98 #include "grit/chromium_strings.h" | 98 #include "grit/chromium_strings.h" |
99 #include "grit/generated_resources.h" | 99 #include "grit/generated_resources.h" |
100 #include "ui/base/l10n/l10n_util.h" | 100 #include "ui/base/l10n/l10n_util.h" |
101 | 101 |
| 102 #if defined(OS_ANDROID) |
| 103 #include "chrome/browser/media/protected_media_identifier_permission_context.h" |
| 104 #include "chrome/browser/media/protected_media_identifier_permission_context_fac
tory.h" |
| 105 #endif // defined(OS_ANDROID) |
| 106 |
102 #if defined(ENABLE_CONFIGURATION_POLICY) | 107 #if defined(ENABLE_CONFIGURATION_POLICY) |
103 #include "chrome/browser/policy/browser_policy_connector.h" | 108 #include "chrome/browser/policy/browser_policy_connector.h" |
104 #include "chrome/browser/policy/schema_registry_service.h" | 109 #include "chrome/browser/policy/schema_registry_service.h" |
105 #include "chrome/browser/policy/schema_registry_service_factory.h" | 110 #include "chrome/browser/policy/schema_registry_service_factory.h" |
106 #if defined(OS_CHROMEOS) | 111 #if defined(OS_CHROMEOS) |
107 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" | 112 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" |
108 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom
eos.h" | 113 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom
eos.h" |
109 #else | 114 #else |
110 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" | 115 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" |
111 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h" | 116 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h" |
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
972 int render_process_id, | 977 int render_process_id, |
973 int render_view_id, | 978 int render_view_id, |
974 int bridge_id, | 979 int bridge_id, |
975 const GURL& requesting_frame) { | 980 const GURL& requesting_frame) { |
976 ChromeMIDIPermissionContext* context = | 981 ChromeMIDIPermissionContext* context = |
977 ChromeMIDIPermissionContextFactory::GetForProfile(this); | 982 ChromeMIDIPermissionContextFactory::GetForProfile(this); |
978 context->CancelMIDISysExPermissionRequest( | 983 context->CancelMIDISysExPermissionRequest( |
979 render_process_id, render_view_id, bridge_id, requesting_frame); | 984 render_process_id, render_view_id, bridge_id, requesting_frame); |
980 } | 985 } |
981 | 986 |
| 987 void ProfileImpl::RequestProtectedMediaIdentifierPermission( |
| 988 int render_process_id, |
| 989 int render_view_id, |
| 990 int bridge_id, |
| 991 int group_id, |
| 992 const GURL& requesting_frame, |
| 993 const ProtectedMediaIdentifierPermissionCallback& callback) { |
| 994 #if defined(OS_ANDROID) |
| 995 ProtectedMediaIdentifierPermissionContext* context = |
| 996 ProtectedMediaIdentifierPermissionContextFactory::GetForProfile(this); |
| 997 context->RequestProtectedMediaIdentifierPermission(render_process_id, |
| 998 render_view_id, |
| 999 bridge_id, |
| 1000 group_id, |
| 1001 requesting_frame, |
| 1002 callback); |
| 1003 #else |
| 1004 NOTIMPLEMENTED(); |
| 1005 callback.Run(false); |
| 1006 #endif // defined(OS_ANDROID) |
| 1007 } |
| 1008 |
| 1009 void ProfileImpl::CancelProtectedMediaIdentifierPermissionRequests( |
| 1010 int group_id) { |
| 1011 #if defined(OS_ANDROID) |
| 1012 ProtectedMediaIdentifierPermissionContext* context = |
| 1013 ProtectedMediaIdentifierPermissionContextFactory::GetForProfile(this); |
| 1014 context->CancelProtectedMediaIdentifierPermissionRequests(group_id); |
| 1015 #else |
| 1016 NOTIMPLEMENTED(); |
| 1017 #endif // defined(OS_ANDROID) |
| 1018 } |
| 1019 |
982 content::ResourceContext* ProfileImpl::GetResourceContext() { | 1020 content::ResourceContext* ProfileImpl::GetResourceContext() { |
983 return io_data_.GetResourceContext(); | 1021 return io_data_.GetResourceContext(); |
984 } | 1022 } |
985 | 1023 |
986 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForExtensions() { | 1024 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForExtensions() { |
987 return io_data_.GetExtensionsRequestContextGetter().get(); | 1025 return io_data_.GetExtensionsRequestContextGetter().get(); |
988 } | 1026 } |
989 | 1027 |
990 net::URLRequestContextGetter* | 1028 net::URLRequestContextGetter* |
991 ProfileImpl::CreateRequestContextForStoragePartition( | 1029 ProfileImpl::CreateRequestContextForStoragePartition( |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1283 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() { | 1321 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() { |
1284 #if defined(OS_CHROMEOS) | 1322 #if defined(OS_CHROMEOS) |
1285 if (chromeos::ProfileHelper::IsSigninProfile(this)) { | 1323 if (chromeos::ProfileHelper::IsSigninProfile(this)) { |
1286 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( | 1324 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( |
1287 g_browser_process->local_state()); | 1325 g_browser_process->local_state()); |
1288 } | 1326 } |
1289 #endif // defined(OS_CHROMEOS) | 1327 #endif // defined(OS_CHROMEOS) |
1290 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( | 1328 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( |
1291 GetPrefs(), g_browser_process->local_state()); | 1329 GetPrefs(), g_browser_process->local_state()); |
1292 } | 1330 } |
OLD | NEW |