| 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 11 matching lines...) Expand all Loading... |
| 22 #include "chrome/browser/download/download_service_factory.h" | 22 #include "chrome/browser/download/download_service_factory.h" |
| 23 #include "chrome/browser/io_thread.h" | 23 #include "chrome/browser/io_thread.h" |
| 24 #include "chrome/browser/net/chrome_url_request_context_getter.h" | 24 #include "chrome/browser/net/chrome_url_request_context_getter.h" |
| 25 #include "chrome/browser/net/proxy_service_factory.h" | 25 #include "chrome/browser/net/proxy_service_factory.h" |
| 26 #include "chrome/browser/permissions/permission_manager.h" | 26 #include "chrome/browser/permissions/permission_manager.h" |
| 27 #include "chrome/browser/permissions/permission_manager_factory.h" | 27 #include "chrome/browser/permissions/permission_manager_factory.h" |
| 28 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" | 28 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" |
| 29 #include "chrome/browser/plugins/plugin_prefs.h" | 29 #include "chrome/browser/plugins/plugin_prefs.h" |
| 30 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 30 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 31 #include "chrome/browser/prefs/pref_service_syncable.h" | 31 #include "chrome/browser/prefs/pref_service_syncable.h" |
| 32 #include "chrome/browser/prefs/pref_service_syncable_util.h" |
| 32 #include "chrome/browser/profiles/profile_manager.h" | 33 #include "chrome/browser/profiles/profile_manager.h" |
| 33 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" | 34 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" |
| 34 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h" | 35 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h" |
| 35 #include "chrome/browser/themes/theme_service.h" | 36 #include "chrome/browser/themes/theme_service.h" |
| 36 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 37 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
| 37 #include "chrome/browser/ui/zoom/chrome_zoom_level_otr_delegate.h" | 38 #include "chrome/browser/ui/zoom/chrome_zoom_level_otr_delegate.h" |
| 38 #include "chrome/common/chrome_constants.h" | 39 #include "chrome/common/chrome_constants.h" |
| 39 #include "chrome/common/chrome_paths.h" | 40 #include "chrome/common/chrome_paths.h" |
| 40 #include "chrome/common/chrome_switches.h" | 41 #include "chrome/common/chrome_switches.h" |
| 41 #include "components/content_settings/core/browser/host_content_settings_map.h" | 42 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 void* otr_profile) { | 105 void* otr_profile) { |
| 105 extensions::ExtensionWebRequestEventRouter::GetInstance() | 106 extensions::ExtensionWebRequestEventRouter::GetInstance() |
| 106 ->OnOTRBrowserContextDestroyed(original_profile, otr_profile); | 107 ->OnOTRBrowserContextDestroyed(original_profile, otr_profile); |
| 107 } | 108 } |
| 108 | 109 |
| 109 } // namespace | 110 } // namespace |
| 110 #endif | 111 #endif |
| 111 | 112 |
| 112 OffTheRecordProfileImpl::OffTheRecordProfileImpl(Profile* real_profile) | 113 OffTheRecordProfileImpl::OffTheRecordProfileImpl(Profile* real_profile) |
| 113 : profile_(real_profile), | 114 : profile_(real_profile), |
| 114 prefs_(PrefServiceSyncable::IncognitoFromProfile(real_profile)), | 115 prefs_(PrefServiceSyncableIncognitoFromProfile(real_profile)), |
| 115 start_time_(Time::Now()) { | 116 start_time_(Time::Now()) { |
| 116 // Register on BrowserContext. | 117 // Register on BrowserContext. |
| 117 user_prefs::UserPrefs::Set(this, prefs_); | 118 user_prefs::UserPrefs::Set(this, prefs_); |
| 118 } | 119 } |
| 119 | 120 |
| 120 void OffTheRecordProfileImpl::Init() { | 121 void OffTheRecordProfileImpl::Init() { |
| 121 // The construction of OffTheRecordProfileIOData::Handle needs the profile | 122 // The construction of OffTheRecordProfileIOData::Handle needs the profile |
| 122 // type returned by this->GetProfileType(). Since GetProfileType() is a | 123 // type returned by this->GetProfileType(). Since GetProfileType() is a |
| 123 // virtual member function, we cannot call the function defined in the most | 124 // virtual member function, we cannot call the function defined in the most |
| 124 // derived class (e.g. GuestSessionProfile) until a ctor finishes. Thus, | 125 // derived class (e.g. GuestSessionProfile) until a ctor finishes. Thus, |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { | 560 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { |
| 560 #if defined(OS_CHROMEOS) | 561 #if defined(OS_CHROMEOS) |
| 561 if (chromeos::ProfileHelper::IsSigninProfile(this)) { | 562 if (chromeos::ProfileHelper::IsSigninProfile(this)) { |
| 562 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( | 563 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( |
| 563 g_browser_process->local_state()); | 564 g_browser_process->local_state()); |
| 564 } | 565 } |
| 565 #endif // defined(OS_CHROMEOS) | 566 #endif // defined(OS_CHROMEOS) |
| 566 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( | 567 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( |
| 567 GetPrefs(), g_browser_process->local_state()); | 568 GetPrefs(), g_browser_process->local_state()); |
| 568 } | 569 } |
| OLD | NEW |