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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 // | 215 // |
216 //////////////////////////////////////////////////////////////////////////////// | 216 //////////////////////////////////////////////////////////////////////////////// |
217 class OffTheRecordProfileImpl : public Profile, | 217 class OffTheRecordProfileImpl : public Profile, |
218 public BrowserList::Observer { | 218 public BrowserList::Observer { |
219 public: | 219 public: |
220 explicit OffTheRecordProfileImpl(Profile* real_profile) | 220 explicit OffTheRecordProfileImpl(Profile* real_profile) |
221 : profile_(real_profile), | 221 : profile_(real_profile), |
222 prefs_(real_profile->GetOffTheRecordPrefs()), | 222 prefs_(real_profile->GetOffTheRecordPrefs()), |
223 ALLOW_THIS_IN_INITIALIZER_LIST(io_data_(this)), | 223 ALLOW_THIS_IN_INITIALIZER_LIST(io_data_(this)), |
224 start_time_(Time::Now()) { | 224 start_time_(Time::Now()) { |
225 #ifndef NDEBUG | |
226 ProfileDependencyManager::GetInstance()->ProfileNowExists(this); | |
227 #endif | |
228 | |
229 extension_process_manager_.reset(ExtensionProcessManager::Create(this)); | 225 extension_process_manager_.reset(ExtensionProcessManager::Create(this)); |
230 | 226 |
231 BrowserList::AddObserver(this); | 227 BrowserList::AddObserver(this); |
232 | 228 |
233 BackgroundContentsServiceFactory::GetForProfile(this); | 229 ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false); |
234 | 230 |
235 DCHECK(real_profile->GetPrefs()->GetBoolean(prefs::kIncognitoEnabled)); | 231 DCHECK(real_profile->GetPrefs()->GetBoolean(prefs::kIncognitoEnabled)); |
236 | 232 |
237 // TODO(oshima): Remove the need to eagerly initialize the request context | 233 // TODO(oshima): Remove the need to eagerly initialize the request context |
238 // getter. chromeos::OnlineAttempt is illegally trying to access this | 234 // getter. chromeos::OnlineAttempt is illegally trying to access this |
239 // 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 |
240 // prevent a race. | 236 // prevent a race. |
241 #if defined(OS_CHROMEOS) | 237 #if defined(OS_CHROMEOS) |
242 GetRequestContext(); | 238 GetRequestContext(); |
243 #endif // defined(OS_CHROMEOS) | 239 #endif // defined(OS_CHROMEOS) |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 }; | 845 }; |
850 #endif | 846 #endif |
851 | 847 |
852 Profile* Profile::CreateOffTheRecordProfile() { | 848 Profile* Profile::CreateOffTheRecordProfile() { |
853 #if defined(OS_CHROMEOS) | 849 #if defined(OS_CHROMEOS) |
854 if (Profile::IsGuestSession()) | 850 if (Profile::IsGuestSession()) |
855 return new GuestSessionProfile(this); | 851 return new GuestSessionProfile(this); |
856 #endif | 852 #endif |
857 return new OffTheRecordProfileImpl(this); | 853 return new OffTheRecordProfileImpl(this); |
858 } | 854 } |
OLD | NEW |