Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: chrome/browser/profiles/off_the_record_profile_impl.cc

Issue 44083005: policy: Remove UserCloudPolicyManagerFactory's dependency on Profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 io_data_(this), 96 io_data_(this),
97 start_time_(Time::Now()) { 97 start_time_(Time::Now()) {
98 // Register on BrowserContext. 98 // Register on BrowserContext.
99 user_prefs::UserPrefs::Set(this, prefs_); 99 user_prefs::UserPrefs::Set(this, prefs_);
100 } 100 }
101 101
102 void OffTheRecordProfileImpl::Init() { 102 void OffTheRecordProfileImpl::Init() {
103 #if defined(ENABLE_CONFIGURATION_POLICY) && !defined(OS_CHROMEOS) 103 #if defined(ENABLE_CONFIGURATION_POLICY) && !defined(OS_CHROMEOS)
104 // Because UserCloudPolicyManager is in a component, it cannot access 104 // Because UserCloudPolicyManager is in a component, it cannot access
105 // GetOriginalProfile. Instead, we have to inject this relation here. 105 // GetOriginalProfile. Instead, we have to inject this relation here.
106 policy::UserCloudPolicyManagerFactory::RegisterForOffTheRecordProfile( 106 policy::UserCloudPolicyManagerFactory::RegisterForOffTheRecordBrowserContext(
107 this->GetOriginalProfile(), this); 107 this->GetOriginalProfile(), this);
108 #endif 108 #endif
109 109
110 BrowserContextDependencyManager::GetInstance()->CreateBrowserContextServices( 110 BrowserContextDependencyManager::GetInstance()->CreateBrowserContextServices(
111 this); 111 this);
112 112
113 DCHECK_NE(IncognitoModePrefs::DISABLED, 113 DCHECK_NE(IncognitoModePrefs::DISABLED,
114 IncognitoModePrefs::GetAvailability(profile_->GetPrefs())); 114 IncognitoModePrefs::GetAvailability(profile_->GetPrefs()));
115 115
116 #if defined(OS_ANDROID) || defined(OS_IOS) 116 #if defined(OS_ANDROID) || defined(OS_IOS)
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { 505 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() {
506 #if defined(OS_CHROMEOS) 506 #if defined(OS_CHROMEOS)
507 if (chromeos::ProfileHelper::IsSigninProfile(this)) { 507 if (chromeos::ProfileHelper::IsSigninProfile(this)) {
508 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( 508 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState(
509 g_browser_process->local_state()); 509 g_browser_process->local_state());
510 } 510 }
511 #endif // defined(OS_CHROMEOS) 511 #endif // defined(OS_CHROMEOS)
512 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( 512 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile(
513 GetPrefs(), g_browser_process->local_state()); 513 GetPrefs(), g_browser_process->local_state());
514 } 514 }
OLDNEW
« no previous file with comments | « chrome/browser/policy/profile_policy_connector_factory.cc ('k') | chrome/browser/profiles/profile_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698