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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 #if defined(ENABLE_CONFIGURATION_POLICY) && !defined(OS_CHROMEOS) | 117 #if defined(ENABLE_CONFIGURATION_POLICY) && !defined(OS_CHROMEOS) |
118 // Because UserCloudPolicyManager is in a component, it cannot access | 118 // Because UserCloudPolicyManager is in a component, it cannot access |
119 // GetOriginalProfile. Instead, we have to inject this relation here. | 119 // GetOriginalProfile. Instead, we have to inject this relation here. |
120 policy::UserCloudPolicyManagerFactory::RegisterForOffTheRecordBrowserContext( | 120 policy::UserCloudPolicyManagerFactory::RegisterForOffTheRecordBrowserContext( |
121 this->GetOriginalProfile(), this); | 121 this->GetOriginalProfile(), this); |
122 #endif | 122 #endif |
123 | 123 |
124 BrowserContextDependencyManager::GetInstance()->CreateBrowserContextServices( | 124 BrowserContextDependencyManager::GetInstance()->CreateBrowserContextServices( |
125 this); | 125 this); |
126 | 126 |
127 DCHECK_NE(IncognitoModePrefs::DISABLED, | 127 // Guest profiles may always be OTR. Check IncognitoModePrefs otherwise. |
128 IncognitoModePrefs::GetAvailability(profile_->GetPrefs())); | 128 DCHECK(profile_->IsGuestSession() || |
| 129 IncognitoModePrefs::GetAvailability(profile_->GetPrefs()) != |
| 130 IncognitoModePrefs::DISABLED); |
129 | 131 |
130 #if defined(OS_ANDROID) || defined(OS_IOS) | 132 #if defined(OS_ANDROID) || defined(OS_IOS) |
131 UseSystemProxy(); | 133 UseSystemProxy(); |
132 #endif // defined(OS_ANDROID) || defined(OS_IOS) | 134 #endif // defined(OS_ANDROID) || defined(OS_IOS) |
133 | 135 |
134 // TODO(oshima): Remove the need to eagerly initialize the request context | 136 // TODO(oshima): Remove the need to eagerly initialize the request context |
135 // getter. chromeos::OnlineAttempt is illegally trying to access this | 137 // getter. chromeos::OnlineAttempt is illegally trying to access this |
136 // Profile member from a thread other than the UI thread, so we need to | 138 // Profile member from a thread other than the UI thread, so we need to |
137 // prevent a race. | 139 // prevent a race. |
138 #if defined(OS_CHROMEOS) | 140 #if defined(OS_CHROMEOS) |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { | 533 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { |
532 #if defined(OS_CHROMEOS) | 534 #if defined(OS_CHROMEOS) |
533 if (chromeos::ProfileHelper::IsSigninProfile(this)) { | 535 if (chromeos::ProfileHelper::IsSigninProfile(this)) { |
534 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( | 536 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( |
535 g_browser_process->local_state()); | 537 g_browser_process->local_state()); |
536 } | 538 } |
537 #endif // defined(OS_CHROMEOS) | 539 #endif // defined(OS_CHROMEOS) |
538 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( | 540 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( |
539 GetPrefs(), g_browser_process->local_state()); | 541 GetPrefs(), g_browser_process->local_state()); |
540 } | 542 } |
OLD | NEW |