| 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/dom_distiller/profile_utils.h" |
| 20 #include "chrome/browser/download/chrome_download_manager_delegate.h" | 21 #include "chrome/browser/download/chrome_download_manager_delegate.h" |
| 21 #include "chrome/browser/download/download_service.h" | 22 #include "chrome/browser/download/download_service.h" |
| 22 #include "chrome/browser/download/download_service_factory.h" | 23 #include "chrome/browser/download/download_service_factory.h" |
| 23 #include "chrome/browser/extensions/extension_service.h" | 24 #include "chrome/browser/extensions/extension_service.h" |
| 24 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 25 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
| 25 #include "chrome/browser/io_thread.h" | 26 #include "chrome/browser/io_thread.h" |
| 26 #include "chrome/browser/net/chrome_url_request_context_getter.h" | 27 #include "chrome/browser/net/chrome_url_request_context_getter.h" |
| 27 #include "chrome/browser/net/pref_proxy_config_tracker.h" | 28 #include "chrome/browser/net/pref_proxy_config_tracker.h" |
| 28 #include "chrome/browser/net/proxy_service_factory.h" | 29 #include "chrome/browser/net/proxy_service_factory.h" |
| 29 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" | 30 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 #if defined(ENABLE_EXTENSIONS) | 154 #if defined(ENABLE_EXTENSIONS) |
| 154 // Make the chrome//extension-icon/ resource available. | 155 // Make the chrome//extension-icon/ resource available. |
| 155 extensions::ExtensionIconSource* icon_source = | 156 extensions::ExtensionIconSource* icon_source = |
| 156 new extensions::ExtensionIconSource(profile_); | 157 new extensions::ExtensionIconSource(profile_); |
| 157 content::URLDataSource::Add(this, icon_source); | 158 content::URLDataSource::Add(this, icon_source); |
| 158 | 159 |
| 159 BrowserThread::PostTask( | 160 BrowserThread::PostTask( |
| 160 BrowserThread::IO, FROM_HERE, | 161 BrowserThread::IO, FROM_HERE, |
| 161 base::Bind(&NotifyOTRProfileCreatedOnIOThread, profile_, this)); | 162 base::Bind(&NotifyOTRProfileCreatedOnIOThread, profile_, this)); |
| 162 #endif | 163 #endif |
| 164 |
| 165 // The DomDistillerViewerSource is not a normal WebUI so it must be registered |
| 166 // as a URLDataSource early. |
| 167 RegisterDomDistillerViewerSource(this); |
| 163 } | 168 } |
| 164 | 169 |
| 165 OffTheRecordProfileImpl::~OffTheRecordProfileImpl() { | 170 OffTheRecordProfileImpl::~OffTheRecordProfileImpl() { |
| 166 MaybeSendDestroyedNotification(); | 171 MaybeSendDestroyedNotification(); |
| 167 | 172 |
| 168 #if defined(ENABLE_PLUGINS) | 173 #if defined(ENABLE_PLUGINS) |
| 169 ChromePluginServiceFilter::GetInstance()->UnregisterResourceContext( | 174 ChromePluginServiceFilter::GetInstance()->UnregisterResourceContext( |
| 170 io_data_->GetResourceContextNoInit()); | 175 io_data_->GetResourceContextNoInit()); |
| 171 #endif | 176 #endif |
| 172 | 177 |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { | 541 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { |
| 537 #if defined(OS_CHROMEOS) | 542 #if defined(OS_CHROMEOS) |
| 538 if (chromeos::ProfileHelper::IsSigninProfile(this)) { | 543 if (chromeos::ProfileHelper::IsSigninProfile(this)) { |
| 539 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( | 544 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( |
| 540 g_browser_process->local_state()); | 545 g_browser_process->local_state()); |
| 541 } | 546 } |
| 542 #endif // defined(OS_CHROMEOS) | 547 #endif // defined(OS_CHROMEOS) |
| 543 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( | 548 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( |
| 544 GetPrefs(), g_browser_process->local_state()); | 549 GetPrefs(), g_browser_process->local_state()); |
| 545 } | 550 } |
| OLD | NEW |