| 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" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
| 13 #include "base/prefs/json_pref_store.h" | 13 #include "base/prefs/json_pref_store.h" |
| 14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 17 #include "chrome/browser/background/background_contents_service_factory.h" | 17 #include "chrome/browser/background/background_contents_service_factory.h" |
| 18 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
| 19 #include "chrome/browser/content_settings/host_content_settings_map.h" | 19 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 20 #include "chrome/browser/download/chrome_download_manager_delegate.h" | 20 #include "chrome/browser/download/chrome_download_manager_delegate.h" |
| 21 #include "chrome/browser/download/download_service.h" | 21 #include "chrome/browser/download/download_service.h" |
| 22 #include "chrome/browser/download/download_service_factory.h" | 22 #include "chrome/browser/download/download_service_factory.h" |
| 23 #include "chrome/browser/extensions/extension_service.h" |
| 23 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 24 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
| 24 #include "chrome/browser/io_thread.h" | 25 #include "chrome/browser/io_thread.h" |
| 25 #include "chrome/browser/net/chrome_url_request_context_getter.h" | 26 #include "chrome/browser/net/chrome_url_request_context_getter.h" |
| 26 #include "chrome/browser/net/pref_proxy_config_tracker.h" | 27 #include "chrome/browser/net/pref_proxy_config_tracker.h" |
| 27 #include "chrome/browser/net/proxy_service_factory.h" | 28 #include "chrome/browser/net/proxy_service_factory.h" |
| 28 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" | 29 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" |
| 29 #include "chrome/browser/plugins/plugin_prefs.h" | 30 #include "chrome/browser/plugins/plugin_prefs.h" |
| 30 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 31 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 31 #include "chrome/browser/prefs/pref_service_syncable.h" | 32 #include "chrome/browser/prefs/pref_service_syncable.h" |
| 32 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" | 33 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 | 351 |
| 351 HostContentSettingsMap* OffTheRecordProfileImpl::GetHostContentSettingsMap() { | 352 HostContentSettingsMap* OffTheRecordProfileImpl::GetHostContentSettingsMap() { |
| 352 // Retrieve the host content settings map of the parent profile in order to | 353 // Retrieve the host content settings map of the parent profile in order to |
| 353 // ensure the preferences have been migrated. | 354 // ensure the preferences have been migrated. |
| 354 profile_->GetHostContentSettingsMap(); | 355 profile_->GetHostContentSettingsMap(); |
| 355 if (!host_content_settings_map_.get()) { | 356 if (!host_content_settings_map_.get()) { |
| 356 host_content_settings_map_ = new HostContentSettingsMap(GetPrefs(), true); | 357 host_content_settings_map_ = new HostContentSettingsMap(GetPrefs(), true); |
| 357 #if defined(ENABLE_EXTENSIONS) | 358 #if defined(ENABLE_EXTENSIONS) |
| 358 ExtensionService* extension_service = | 359 ExtensionService* extension_service = |
| 359 extensions::ExtensionSystem::Get(this)->extension_service(); | 360 extensions::ExtensionSystem::Get(this)->extension_service(); |
| 360 if (extension_service) | 361 if (extension_service) { |
| 361 host_content_settings_map_->RegisterExtensionService(extension_service); | 362 extension_service->RegisterContentSettings( |
| 363 host_content_settings_map_.get()); |
| 364 } |
| 362 #endif | 365 #endif |
| 363 } | 366 } |
| 364 return host_content_settings_map_.get(); | 367 return host_content_settings_map_.get(); |
| 365 } | 368 } |
| 366 | 369 |
| 367 content::BrowserPluginGuestManager* OffTheRecordProfileImpl::GetGuestManager() { | 370 content::BrowserPluginGuestManager* OffTheRecordProfileImpl::GetGuestManager() { |
| 368 #if defined(ENABLE_EXTENSIONS) | 371 #if defined(ENABLE_EXTENSIONS) |
| 369 return extensions::GuestViewManager::FromBrowserContext(this); | 372 return extensions::GuestViewManager::FromBrowserContext(this); |
| 370 #else | 373 #else |
| 371 return NULL; | 374 return NULL; |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { | 536 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { |
| 534 #if defined(OS_CHROMEOS) | 537 #if defined(OS_CHROMEOS) |
| 535 if (chromeos::ProfileHelper::IsSigninProfile(this)) { | 538 if (chromeos::ProfileHelper::IsSigninProfile(this)) { |
| 536 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( | 539 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( |
| 537 g_browser_process->local_state()); | 540 g_browser_process->local_state()); |
| 538 } | 541 } |
| 539 #endif // defined(OS_CHROMEOS) | 542 #endif // defined(OS_CHROMEOS) |
| 540 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( | 543 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( |
| 541 GetPrefs(), g_browser_process->local_state()); | 544 GetPrefs(), g_browser_process->local_state()); |
| 542 } | 545 } |
| OLD | NEW |