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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 if (!profile_->GetZoomLevelPrefs()) | 218 if (!profile_->GetZoomLevelPrefs()) |
219 return; | 219 return; |
220 | 220 |
221 // Also track changes to the parent profile's default zoom level. | 221 // Also track changes to the parent profile's default zoom level. |
222 parent_default_zoom_level_subscription_ = | 222 parent_default_zoom_level_subscription_ = |
223 profile_->GetZoomLevelPrefs()->RegisterDefaultZoomLevelCallback( | 223 profile_->GetZoomLevelPrefs()->RegisterDefaultZoomLevelCallback( |
224 base::Bind(&OffTheRecordProfileImpl::UpdateDefaultZoomLevel, | 224 base::Bind(&OffTheRecordProfileImpl::UpdateDefaultZoomLevel, |
225 base::Unretained(this))); | 225 base::Unretained(this))); |
226 } | 226 } |
227 | 227 |
228 std::string OffTheRecordProfileImpl::GetProfileUserName() { | 228 std::string OffTheRecordProfileImpl::GetProfileUserName() const { |
229 // Incognito profile should not return the username. | 229 // Incognito profile should not return the username. |
230 return std::string(); | 230 return std::string(); |
231 } | 231 } |
232 | 232 |
233 Profile::ProfileType OffTheRecordProfileImpl::GetProfileType() const { | 233 Profile::ProfileType OffTheRecordProfileImpl::GetProfileType() const { |
234 #if !defined(OS_CHROMEOS) | 234 #if !defined(OS_CHROMEOS) |
235 return profile_->IsGuestSession() ? GUEST_PROFILE : INCOGNITO_PROFILE; | 235 return profile_->IsGuestSession() ? GUEST_PROFILE : INCOGNITO_PROFILE; |
236 #else | 236 #else |
237 return INCOGNITO_PROFILE; | 237 return INCOGNITO_PROFILE; |
238 #endif | 238 #endif |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 } | 291 } |
292 | 292 |
293 bool OffTheRecordProfileImpl::IsLegacySupervised() { | 293 bool OffTheRecordProfileImpl::IsLegacySupervised() { |
294 return GetOriginalProfile()->IsLegacySupervised(); | 294 return GetOriginalProfile()->IsLegacySupervised(); |
295 } | 295 } |
296 | 296 |
297 PrefService* OffTheRecordProfileImpl::GetPrefs() { | 297 PrefService* OffTheRecordProfileImpl::GetPrefs() { |
298 return prefs_; | 298 return prefs_; |
299 } | 299 } |
300 | 300 |
| 301 const PrefService* OffTheRecordProfileImpl::GetPrefs() const { |
| 302 return prefs_; |
| 303 } |
| 304 |
301 PrefService* OffTheRecordProfileImpl::GetOffTheRecordPrefs() { | 305 PrefService* OffTheRecordProfileImpl::GetOffTheRecordPrefs() { |
302 return prefs_; | 306 return prefs_; |
303 } | 307 } |
304 | 308 |
305 DownloadManagerDelegate* OffTheRecordProfileImpl::GetDownloadManagerDelegate() { | 309 DownloadManagerDelegate* OffTheRecordProfileImpl::GetDownloadManagerDelegate() { |
306 return DownloadServiceFactory::GetForBrowserContext(this)-> | 310 return DownloadServiceFactory::GetForBrowserContext(this)-> |
307 GetDownloadManagerDelegate(); | 311 GetDownloadManagerDelegate(); |
308 } | 312 } |
309 | 313 |
310 net::URLRequestContextGetter* OffTheRecordProfileImpl::GetRequestContext() { | 314 net::URLRequestContextGetter* OffTheRecordProfileImpl::GetRequestContext() { |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { | 567 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { |
564 #if defined(OS_CHROMEOS) | 568 #if defined(OS_CHROMEOS) |
565 if (chromeos::ProfileHelper::IsSigninProfile(this)) { | 569 if (chromeos::ProfileHelper::IsSigninProfile(this)) { |
566 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( | 570 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( |
567 g_browser_process->local_state()); | 571 g_browser_process->local_state()); |
568 } | 572 } |
569 #endif // defined(OS_CHROMEOS) | 573 #endif // defined(OS_CHROMEOS) |
570 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( | 574 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( |
571 GetPrefs(), g_browser_process->local_state()); | 575 GetPrefs(), g_browser_process->local_state()); |
572 } | 576 } |
OLD | NEW |