| 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 12 matching lines...) Expand all Loading... |
| 23 #include "chrome/browser/extensions/api/web_request/web_request_api.h" | 23 #include "chrome/browser/extensions/api/web_request/web_request_api.h" |
| 24 #include "chrome/browser/extensions/extension_info_map.h" | 24 #include "chrome/browser/extensions/extension_info_map.h" |
| 25 #include "chrome/browser/extensions/extension_service.h" | 25 #include "chrome/browser/extensions/extension_service.h" |
| 26 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 26 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
| 27 #include "chrome/browser/extensions/extension_system.h" | 27 #include "chrome/browser/extensions/extension_system.h" |
| 28 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h" | 28 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h" |
| 29 #include "chrome/browser/geolocation/chrome_geolocation_permission_context_facto
ry.h" | 29 #include "chrome/browser/geolocation/chrome_geolocation_permission_context_facto
ry.h" |
| 30 #include "chrome/browser/io_thread.h" | 30 #include "chrome/browser/io_thread.h" |
| 31 #include "chrome/browser/media/chrome_midi_permission_context.h" | 31 #include "chrome/browser/media/chrome_midi_permission_context.h" |
| 32 #include "chrome/browser/media/chrome_midi_permission_context_factory.h" | 32 #include "chrome/browser/media/chrome_midi_permission_context_factory.h" |
| 33 #include "chrome/browser/net/cookie_store_util.h" |
| 33 #include "chrome/browser/net/pref_proxy_config_tracker.h" | 34 #include "chrome/browser/net/pref_proxy_config_tracker.h" |
| 34 #include "chrome/browser/net/proxy_service_factory.h" | 35 #include "chrome/browser/net/proxy_service_factory.h" |
| 35 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" | 36 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" |
| 36 #include "chrome/browser/plugins/plugin_prefs.h" | 37 #include "chrome/browser/plugins/plugin_prefs.h" |
| 37 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 38 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 38 #include "chrome/browser/prefs/pref_service_syncable.h" | 39 #include "chrome/browser/prefs/pref_service_syncable.h" |
| 39 #include "chrome/browser/themes/theme_service.h" | 40 #include "chrome/browser/themes/theme_service.h" |
| 40 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 41 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
| 41 #include "chrome/common/chrome_constants.h" | 42 #include "chrome/common/chrome_constants.h" |
| 42 #include "chrome/common/chrome_paths.h" | 43 #include "chrome/common/chrome_paths.h" |
| 43 #include "chrome/common/chrome_switches.h" | 44 #include "chrome/common/chrome_switches.h" |
| 44 #include "chrome/common/extensions/extension.h" | 45 #include "chrome/common/extensions/extension.h" |
| 45 #include "chrome/common/pref_names.h" | 46 #include "chrome/common/pref_names.h" |
| 46 #include "chrome/common/render_messages.h" | 47 #include "chrome/common/render_messages.h" |
| 47 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" | 48 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" |
| 48 #include "components/user_prefs/user_prefs.h" | 49 #include "components/user_prefs/user_prefs.h" |
| 49 #include "content/public/browser/browser_thread.h" | 50 #include "content/public/browser/browser_thread.h" |
| 51 #include "content/public/browser/cookie_store_factory.h" |
| 50 #include "content/public/browser/host_zoom_map.h" | 52 #include "content/public/browser/host_zoom_map.h" |
| 51 #include "content/public/browser/render_process_host.h" | 53 #include "content/public/browser/render_process_host.h" |
| 52 #include "content/public/browser/storage_partition.h" | 54 #include "content/public/browser/storage_partition.h" |
| 53 #include "content/public/browser/url_data_source.h" | 55 #include "content/public/browser/url_data_source.h" |
| 54 #include "content/public/browser/web_contents.h" | 56 #include "content/public/browser/web_contents.h" |
| 55 #include "net/http/http_server_properties.h" | 57 #include "net/http/http_server_properties.h" |
| 56 #include "net/http/transport_security_state.h" | 58 #include "net/http/transport_security_state.h" |
| 57 #include "webkit/browser/database/database_tracker.h" | 59 #include "webkit/browser/database/database_tracker.h" |
| 58 | 60 |
| 59 #if defined(OS_ANDROID) || defined(OS_IOS) | 61 #if defined(OS_ANDROID) || defined(OS_IOS) |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 | 193 |
| 192 std::string OffTheRecordProfileImpl::GetProfileName() { | 194 std::string OffTheRecordProfileImpl::GetProfileName() { |
| 193 // Incognito profile should not return the profile name. | 195 // Incognito profile should not return the profile name. |
| 194 return std::string(); | 196 return std::string(); |
| 195 } | 197 } |
| 196 | 198 |
| 197 base::FilePath OffTheRecordProfileImpl::GetPath() const { | 199 base::FilePath OffTheRecordProfileImpl::GetPath() const { |
| 198 return profile_->GetPath(); | 200 return profile_->GetPath(); |
| 199 } | 201 } |
| 200 | 202 |
| 203 content::CookieStoreConfig OffTheRecordProfileImpl::GetCookieStoreConfig() { |
| 204 if (!cookie_delegate_) { |
| 205 cookie_delegate_ = chrome_browser_net::CreateCookieDelegate(this); |
| 206 } |
| 207 |
| 208 return content::CookieStoreConfig::InMemoryWithOptions( |
| 209 GetExtensionSpecialStoragePolicy(), cookie_delegate_); |
| 210 } |
| 211 |
| 201 scoped_refptr<base::SequencedTaskRunner> | 212 scoped_refptr<base::SequencedTaskRunner> |
| 202 OffTheRecordProfileImpl::GetIOTaskRunner() { | 213 OffTheRecordProfileImpl::GetIOTaskRunner() { |
| 203 return profile_->GetIOTaskRunner(); | 214 return profile_->GetIOTaskRunner(); |
| 204 } | 215 } |
| 205 | 216 |
| 206 bool OffTheRecordProfileImpl::IsOffTheRecord() const { | 217 bool OffTheRecordProfileImpl::IsOffTheRecord() const { |
| 207 return true; | 218 return true; |
| 208 } | 219 } |
| 209 | 220 |
| 210 Profile* OffTheRecordProfileImpl::GetOffTheRecordProfile() { | 221 Profile* OffTheRecordProfileImpl::GetOffTheRecordProfile() { |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 const MIDISysExPermissionCallback& callback) { | 306 const MIDISysExPermissionCallback& callback) { |
| 296 ChromeMIDIPermissionContext* context = | 307 ChromeMIDIPermissionContext* context = |
| 297 ChromeMIDIPermissionContextFactory::GetForProfile(this); | 308 ChromeMIDIPermissionContextFactory::GetForProfile(this); |
| 298 context->RequestMIDISysExPermission(render_process_id, | 309 context->RequestMIDISysExPermission(render_process_id, |
| 299 render_view_id, | 310 render_view_id, |
| 300 requesting_frame, | 311 requesting_frame, |
| 301 callback); | 312 callback); |
| 302 } | 313 } |
| 303 | 314 |
| 304 net::URLRequestContextGetter* | 315 net::URLRequestContextGetter* |
| 305 OffTheRecordProfileImpl::GetRequestContextForExtensions() { | |
| 306 return io_data_.GetExtensionsRequestContextGetter().get(); | |
| 307 } | |
| 308 | |
| 309 net::URLRequestContextGetter* | |
| 310 OffTheRecordProfileImpl::CreateRequestContextForStoragePartition( | 316 OffTheRecordProfileImpl::CreateRequestContextForStoragePartition( |
| 311 const base::FilePath& partition_path, | 317 const base::FilePath& partition_path, |
| 312 bool in_memory, | 318 bool in_memory, |
| 313 content::ProtocolHandlerMap* protocol_handlers) { | 319 content::ProtocolHandlerMap* protocol_handlers) { |
| 314 return io_data_.CreateIsolatedAppRequestContextGetter( | 320 return io_data_.CreateIsolatedAppRequestContextGetter( |
| 315 partition_path, in_memory, protocol_handlers).get(); | 321 partition_path, in_memory, protocol_handlers).get(); |
| 316 } | 322 } |
| 317 | 323 |
| 318 content::ResourceContext* OffTheRecordProfileImpl::GetResourceContext() { | 324 content::ResourceContext* OffTheRecordProfileImpl::GetResourceContext() { |
| 319 return io_data_.GetResourceContext(); | 325 return io_data_.GetResourceContext(); |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 #if defined(OS_CHROMEOS) | 496 #if defined(OS_CHROMEOS) |
| 491 if (chromeos::ProfileHelper::IsSigninProfile(this)) { | 497 if (chromeos::ProfileHelper::IsSigninProfile(this)) { |
| 492 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( | 498 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( |
| 493 g_browser_process->local_state()); | 499 g_browser_process->local_state()); |
| 494 } | 500 } |
| 495 #endif // defined(OS_CHROMEOS) | 501 #endif // defined(OS_CHROMEOS) |
| 496 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( | 502 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( |
| 497 GetPrefs(), g_browser_process->local_state()); | 503 GetPrefs(), g_browser_process->local_state()); |
| 498 } | 504 } |
| 499 | 505 |
| OLD | NEW |