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/off_the_record_profile_impl.h" | 5 #include "chrome/browser/profiles/off_the_record_profile_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 | 73 |
74 #if defined(ENABLE_EXTENSIONS) | 74 #if defined(ENABLE_EXTENSIONS) |
75 #include "chrome/browser/extensions/extension_service.h" | 75 #include "chrome/browser/extensions/extension_service.h" |
76 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 76 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
77 #include "extensions/browser/api/web_request/web_request_api.h" | 77 #include "extensions/browser/api/web_request/web_request_api.h" |
78 #include "extensions/browser/extension_system.h" | 78 #include "extensions/browser/extension_system.h" |
79 #include "extensions/browser/guest_view/guest_view_manager.h" | 79 #include "extensions/browser/guest_view/guest_view_manager.h" |
80 #include "extensions/common/extension.h" | 80 #include "extensions/common/extension.h" |
81 #endif | 81 #endif |
82 | 82 |
83 #if defined(ENABLE_SUPERVISED_USERS) | |
84 #include "chrome/browser/content_settings/content_settings_supervised_provider.h " | |
85 #include "chrome/browser/supervised_user/supervised_user_settings_service.h" | |
86 #include "chrome/browser/supervised_user/supervised_user_settings_service_factor y.h" | |
87 #endif | |
88 | |
83 using content::BrowserThread; | 89 using content::BrowserThread; |
84 using content::DownloadManagerDelegate; | 90 using content::DownloadManagerDelegate; |
85 using content::HostZoomMap; | 91 using content::HostZoomMap; |
86 | 92 |
87 #if defined(ENABLE_EXTENSIONS) | 93 #if defined(ENABLE_EXTENSIONS) |
88 namespace { | 94 namespace { |
89 | 95 |
90 void NotifyOTRProfileCreatedOnIOThread(void* original_profile, | 96 void NotifyOTRProfileCreatedOnIOThread(void* original_profile, |
91 void* otr_profile) { | 97 void* otr_profile) { |
92 ExtensionWebRequestEventRouter::GetInstance()->OnOTRBrowserContextCreated( | 98 ExtensionWebRequestEventRouter::GetInstance()->OnOTRBrowserContextCreated( |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
385 if (!host_content_settings_map_.get()) { | 391 if (!host_content_settings_map_.get()) { |
386 host_content_settings_map_ = new HostContentSettingsMap(GetPrefs(), true); | 392 host_content_settings_map_ = new HostContentSettingsMap(GetPrefs(), true); |
387 #if defined(ENABLE_EXTENSIONS) | 393 #if defined(ENABLE_EXTENSIONS) |
388 ExtensionService* extension_service = | 394 ExtensionService* extension_service = |
389 extensions::ExtensionSystem::Get(this)->extension_service(); | 395 extensions::ExtensionSystem::Get(this)->extension_service(); |
390 if (extension_service) { | 396 if (extension_service) { |
391 extension_service->RegisterContentSettings( | 397 extension_service->RegisterContentSettings( |
392 host_content_settings_map_.get()); | 398 host_content_settings_map_.get()); |
393 } | 399 } |
394 #endif | 400 #endif |
401 #if defined(ENABLE_SUPERVISED_USERS) | |
402 SupervisedUserSettingsService* supervised_service = | |
403 SupervisedUserSettingsServiceFactory::GetForProfile(this); | |
404 scoped_ptr<content_settings::SupervisedProvider> supervised_provider( | |
405 new content_settings::SupervisedProvider()); | |
Bernhard Bauer
2015/02/26 18:03:54
The supervised_provider can subscribe itself to th
knn
2015/02/27 10:43:53
Done.
| |
406 supervised_service->Subscribe(base::Bind( | |
407 &content_settings::SupervisedProvider::OnSupervisedSettingsAvailable, | |
408 base::Unretained(supervised_provider.get()))); | |
409 host_content_settings_map_->RegisterProvider( | |
410 HostContentSettingsMap::SUPERVISED_PROVIDER, | |
411 supervised_provider.Pass()); | |
412 #endif | |
395 } | 413 } |
396 return host_content_settings_map_.get(); | 414 return host_content_settings_map_.get(); |
397 } | 415 } |
398 | 416 |
399 content::BrowserPluginGuestManager* OffTheRecordProfileImpl::GetGuestManager() { | 417 content::BrowserPluginGuestManager* OffTheRecordProfileImpl::GetGuestManager() { |
400 #if defined(ENABLE_EXTENSIONS) | 418 #if defined(ENABLE_EXTENSIONS) |
401 return extensions::GuestViewManager::FromBrowserContext(this); | 419 return extensions::GuestViewManager::FromBrowserContext(this); |
402 #else | 420 #else |
403 return NULL; | 421 return NULL; |
404 #endif | 422 #endif |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
567 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { | 585 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { |
568 #if defined(OS_CHROMEOS) | 586 #if defined(OS_CHROMEOS) |
569 if (chromeos::ProfileHelper::IsSigninProfile(this)) { | 587 if (chromeos::ProfileHelper::IsSigninProfile(this)) { |
570 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( | 588 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( |
571 g_browser_process->local_state()); | 589 g_browser_process->local_state()); |
572 } | 590 } |
573 #endif // defined(OS_CHROMEOS) | 591 #endif // defined(OS_CHROMEOS) |
574 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( | 592 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( |
575 GetPrefs(), g_browser_process->local_state()); | 593 GetPrefs(), g_browser_process->local_state()); |
576 } | 594 } |
OLD | NEW |