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

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

Issue 52343002: policy: Register OffTheRecordProfile at UserCloudPolicyManagerFactory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 #if defined(OS_ANDROID) || defined(OS_IOS) 59 #if defined(OS_ANDROID) || defined(OS_IOS)
60 #include "chrome/browser/prefs/proxy_prefs.h" 60 #include "chrome/browser/prefs/proxy_prefs.h"
61 #include "chrome/browser/prefs/scoped_user_pref_update.h" 61 #include "chrome/browser/prefs/scoped_user_pref_update.h"
62 #endif // defined(OS_ANDROID) || defined(OS_IOS) 62 #endif // defined(OS_ANDROID) || defined(OS_IOS)
63 63
64 #if defined(OS_CHROMEOS) 64 #if defined(OS_CHROMEOS)
65 #include "chrome/browser/chromeos/preferences.h" 65 #include "chrome/browser/chromeos/preferences.h"
66 #include "chrome/browser/chromeos/profiles/profile_helper.h" 66 #include "chrome/browser/chromeos/profiles/profile_helper.h"
67 #endif 67 #endif
68 68
69 #if defined(ENABLE_CONFIGURATION_POLICY) && !defined(OS_CHROMEOS)
70 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h"
71 #endif
72
69 using content::BrowserThread; 73 using content::BrowserThread;
70 using content::DownloadManagerDelegate; 74 using content::DownloadManagerDelegate;
71 using content::HostZoomMap; 75 using content::HostZoomMap;
72 76
73 namespace { 77 namespace {
74 78
75 void NotifyOTRProfileCreatedOnIOThread(void* original_profile, 79 void NotifyOTRProfileCreatedOnIOThread(void* original_profile,
76 void* otr_profile) { 80 void* otr_profile) {
77 ExtensionWebRequestEventRouter::GetInstance()->OnOTRProfileCreated( 81 ExtensionWebRequestEventRouter::GetInstance()->OnOTRProfileCreated(
78 original_profile, otr_profile); 82 original_profile, otr_profile);
(...skipping 10 matching lines...) Expand all
89 OffTheRecordProfileImpl::OffTheRecordProfileImpl(Profile* real_profile) 93 OffTheRecordProfileImpl::OffTheRecordProfileImpl(Profile* real_profile)
90 : profile_(real_profile), 94 : profile_(real_profile),
91 prefs_(PrefServiceSyncable::IncognitoFromProfile(real_profile)), 95 prefs_(PrefServiceSyncable::IncognitoFromProfile(real_profile)),
92 io_data_(this), 96 io_data_(this),
93 start_time_(Time::Now()) { 97 start_time_(Time::Now()) {
94 // Register on BrowserContext. 98 // Register on BrowserContext.
95 user_prefs::UserPrefs::Set(this, prefs_); 99 user_prefs::UserPrefs::Set(this, prefs_);
96 } 100 }
97 101
98 void OffTheRecordProfileImpl::Init() { 102 void OffTheRecordProfileImpl::Init() {
103 #if defined(ENABLE_CONFIGURATION_POLICY) && !defined(OS_CHROMEOS)
104 policy::UserCloudPolicyManagerFactory::RegisterForOffTheRecordProfile(
105 this->GetOriginalProfile(), this);
106 #endif
Joao da Silva 2013/11/04 09:53:38 Document why this is needed.
pneubeck (no reviews) 2013/11/04 12:38:50 Done.
107
99 BrowserContextDependencyManager::GetInstance()->CreateBrowserContextServices( 108 BrowserContextDependencyManager::GetInstance()->CreateBrowserContextServices(
100 this); 109 this);
101 110
102 DCHECK_NE(IncognitoModePrefs::DISABLED, 111 DCHECK_NE(IncognitoModePrefs::DISABLED,
103 IncognitoModePrefs::GetAvailability(profile_->GetPrefs())); 112 IncognitoModePrefs::GetAvailability(profile_->GetPrefs()));
104 113
105 #if defined(OS_ANDROID) || defined(OS_IOS) 114 #if defined(OS_ANDROID) || defined(OS_IOS)
106 UseSystemProxy(); 115 UseSystemProxy();
107 #endif // defined(OS_ANDROID) || defined(OS_IOS) 116 #endif // defined(OS_ANDROID) || defined(OS_IOS)
108 117
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { 495 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() {
487 #if defined(OS_CHROMEOS) 496 #if defined(OS_CHROMEOS)
488 if (chromeos::ProfileHelper::IsSigninProfile(this)) { 497 if (chromeos::ProfileHelper::IsSigninProfile(this)) {
489 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( 498 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState(
490 g_browser_process->local_state()); 499 g_browser_process->local_state());
491 } 500 }
492 #endif // defined(OS_CHROMEOS) 501 #endif // defined(OS_CHROMEOS)
493 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( 502 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile(
494 GetPrefs(), g_browser_process->local_state()); 503 GetPrefs(), g_browser_process->local_state());
495 } 504 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698