| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 ->OnOTRBrowserContextDestroyed(original_profile, otr_profile); | 111 ->OnOTRBrowserContextDestroyed(original_profile, otr_profile); |
| 112 } | 112 } |
| 113 | 113 |
| 114 } // namespace | 114 } // namespace |
| 115 #endif | 115 #endif |
| 116 | 116 |
| 117 OffTheRecordProfileImpl::OffTheRecordProfileImpl(Profile* real_profile) | 117 OffTheRecordProfileImpl::OffTheRecordProfileImpl(Profile* real_profile) |
| 118 : profile_(real_profile), | 118 : profile_(real_profile), |
| 119 prefs_(PrefServiceSyncableIncognitoFromProfile(real_profile)), | 119 prefs_(PrefServiceSyncableIncognitoFromProfile(real_profile)), |
| 120 start_time_(Time::Now()) { | 120 start_time_(Time::Now()) { |
| 121 BrowserContext::Initialize(this, profile_->GetPath()); |
| 121 // Register on BrowserContext. | 122 // Register on BrowserContext. |
| 122 user_prefs::UserPrefs::Set(this, prefs_); | 123 user_prefs::UserPrefs::Set(this, prefs_); |
| 123 } | 124 } |
| 124 | 125 |
| 125 void OffTheRecordProfileImpl::Init() { | 126 void OffTheRecordProfileImpl::Init() { |
| 126 // The construction of OffTheRecordProfileIOData::Handle needs the profile | 127 // The construction of OffTheRecordProfileIOData::Handle needs the profile |
| 127 // type returned by this->GetProfileType(). Since GetProfileType() is a | 128 // type returned by this->GetProfileType(). Since GetProfileType() is a |
| 128 // virtual member function, we cannot call the function defined in the most | 129 // virtual member function, we cannot call the function defined in the most |
| 129 // derived class (e.g. GuestSessionProfile) until a ctor finishes. Thus, | 130 // derived class (e.g. GuestSessionProfile) until a ctor finishes. Thus, |
| 130 // we have to instantiate OffTheRecordProfileIOData::Handle here after a ctor. | 131 // we have to instantiate OffTheRecordProfileIOData::Handle here after a ctor. |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { | 567 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { |
| 567 #if defined(OS_CHROMEOS) | 568 #if defined(OS_CHROMEOS) |
| 568 if (chromeos::ProfileHelper::IsSigninProfile(this)) { | 569 if (chromeos::ProfileHelper::IsSigninProfile(this)) { |
| 569 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( | 570 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( |
| 570 g_browser_process->local_state()); | 571 g_browser_process->local_state()); |
| 571 } | 572 } |
| 572 #endif // defined(OS_CHROMEOS) | 573 #endif // defined(OS_CHROMEOS) |
| 573 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( | 574 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( |
| 574 GetPrefs(), g_browser_process->local_state()); | 575 GetPrefs(), g_browser_process->local_state()); |
| 575 } | 576 } |
| OLD | NEW |