Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/profile.h" | 5 #include "chrome/browser/profiles/profile.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 213 // | 213 // |
| 214 //////////////////////////////////////////////////////////////////////////////// | 214 //////////////////////////////////////////////////////////////////////////////// |
| 215 class OffTheRecordProfileImpl : public Profile, | 215 class OffTheRecordProfileImpl : public Profile, |
| 216 public BrowserList::Observer { | 216 public BrowserList::Observer { |
| 217 public: | 217 public: |
| 218 explicit OffTheRecordProfileImpl(Profile* real_profile) | 218 explicit OffTheRecordProfileImpl(Profile* real_profile) |
| 219 : profile_(real_profile), | 219 : profile_(real_profile), |
| 220 prefs_(real_profile->GetOffTheRecordPrefs()), | 220 prefs_(real_profile->GetOffTheRecordPrefs()), |
| 221 ALLOW_THIS_IN_INITIALIZER_LIST(io_data_(this)), | 221 ALLOW_THIS_IN_INITIALIZER_LIST(io_data_(this)), |
| 222 start_time_(Time::Now()) { | 222 start_time_(Time::Now()) { |
| 223 #ifndef NDEBUG | |
| 224 ProfileDependencyManager::GetInstance()->ProfileNowExists(this); | |
| 225 #endif | |
| 226 | |
| 227 extension_process_manager_.reset(ExtensionProcessManager::Create(this)); | 223 extension_process_manager_.reset(ExtensionProcessManager::Create(this)); |
| 228 | 224 |
| 229 BrowserList::AddObserver(this); | 225 BrowserList::AddObserver(this); |
| 230 | 226 |
| 227 ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false); | |
| 228 | |
| 231 BackgroundContentsServiceFactory::GetForProfile(this); | 229 BackgroundContentsServiceFactory::GetForProfile(this); |
|
Elliot Glaysher
2011/06/30 23:55:03
(Realized I missed this one)
| |
| 232 | 230 |
| 233 DCHECK(real_profile->GetPrefs()->GetBoolean(prefs::kIncognitoEnabled)); | 231 DCHECK(real_profile->GetPrefs()->GetBoolean(prefs::kIncognitoEnabled)); |
| 234 | 232 |
| 235 // TODO(oshima): Remove the need to eagerly initialize the request context | 233 // TODO(oshima): Remove the need to eagerly initialize the request context |
| 236 // getter. chromeos::OnlineAttempt is illegally trying to access this | 234 // getter. chromeos::OnlineAttempt is illegally trying to access this |
| 237 // Profile member from a thread other than the UI thread, so we need to | 235 // Profile member from a thread other than the UI thread, so we need to |
| 238 // prevent a race. | 236 // prevent a race. |
| 239 #if defined(OS_CHROMEOS) | 237 #if defined(OS_CHROMEOS) |
| 240 GetRequestContext(); | 238 GetRequestContext(); |
| 241 #endif // defined(OS_CHROMEOS) | 239 #endif // defined(OS_CHROMEOS) |
| (...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 852 }; | 850 }; |
| 853 #endif | 851 #endif |
| 854 | 852 |
| 855 Profile* Profile::CreateOffTheRecordProfile() { | 853 Profile* Profile::CreateOffTheRecordProfile() { |
| 856 #if defined(OS_CHROMEOS) | 854 #if defined(OS_CHROMEOS) |
| 857 if (Profile::IsGuestSession()) | 855 if (Profile::IsGuestSession()) |
| 858 return new GuestSessionProfile(this); | 856 return new GuestSessionProfile(this); |
| 859 #endif | 857 #endif |
| 860 return new OffTheRecordProfileImpl(this); | 858 return new OffTheRecordProfileImpl(this); |
| 861 } | 859 } |
| OLD | NEW |