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/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 OffTheRecordProfileImpl::OffTheRecordProfileImpl(Profile* real_profile) | 82 OffTheRecordProfileImpl::OffTheRecordProfileImpl(Profile* real_profile) |
83 : profile_(real_profile), | 83 : profile_(real_profile), |
84 prefs_(real_profile->GetOffTheRecordPrefs()), | 84 prefs_(real_profile->GetOffTheRecordPrefs()), |
85 ALLOW_THIS_IN_INITIALIZER_LIST(io_data_(this)), | 85 ALLOW_THIS_IN_INITIALIZER_LIST(io_data_(this)), |
86 start_time_(Time::Now()) { | 86 start_time_(Time::Now()) { |
87 } | 87 } |
88 | 88 |
89 void OffTheRecordProfileImpl::Init() { | 89 void OffTheRecordProfileImpl::Init() { |
90 ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false); | 90 ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false); |
91 | 91 |
| 92 extensions::ExtensionSystem::Get(this)->InitForOTRProfile(); |
| 93 |
92 DCHECK_NE(IncognitoModePrefs::DISABLED, | 94 DCHECK_NE(IncognitoModePrefs::DISABLED, |
93 IncognitoModePrefs::GetAvailability(profile_->GetPrefs())); | 95 IncognitoModePrefs::GetAvailability(profile_->GetPrefs())); |
94 | 96 |
95 // TODO(oshima): Remove the need to eagerly initialize the request context | 97 // TODO(oshima): Remove the need to eagerly initialize the request context |
96 // getter. chromeos::OnlineAttempt is illegally trying to access this | 98 // getter. chromeos::OnlineAttempt is illegally trying to access this |
97 // Profile member from a thread other than the UI thread, so we need to | 99 // Profile member from a thread other than the UI thread, so we need to |
98 // prevent a race. | 100 // prevent a race. |
99 #if defined(OS_CHROMEOS) | 101 #if defined(OS_CHROMEOS) |
100 GetRequestContext(); | 102 GetRequestContext(); |
101 #endif // defined(OS_CHROMEOS) | 103 #endif // defined(OS_CHROMEOS) |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 if (!profile) | 482 if (!profile) |
481 profile = new OffTheRecordProfileImpl(this); | 483 profile = new OffTheRecordProfileImpl(this); |
482 profile->Init(); | 484 profile->Init(); |
483 return profile; | 485 return profile; |
484 } | 486 } |
485 | 487 |
486 base::Callback<ChromeURLDataManagerBackend*(void)> | 488 base::Callback<ChromeURLDataManagerBackend*(void)> |
487 OffTheRecordProfileImpl::GetChromeURLDataManagerBackendGetter() const { | 489 OffTheRecordProfileImpl::GetChromeURLDataManagerBackendGetter() const { |
488 return io_data_.GetChromeURLDataManagerBackendGetter(); | 490 return io_data_.GetChromeURLDataManagerBackendGetter(); |
489 } | 491 } |
OLD | NEW |