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

Side by Side Diff: chrome/browser/chromeos/login/login_utils.cc

Issue 6979011: Move user cloud policy to BrowserProcess. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 months 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/chromeos/login/login_utils.h" 5 #include "chrome/browser/chromeos/login/login_utils.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 20 matching lines...) Expand all
31 #include "chrome/browser/chromeos/login/ownership_service.h" 31 #include "chrome/browser/chromeos/login/ownership_service.h"
32 #include "chrome/browser/chromeos/login/parallel_authenticator.h" 32 #include "chrome/browser/chromeos/login/parallel_authenticator.h"
33 #include "chrome/browser/chromeos/login/user_manager.h" 33 #include "chrome/browser/chromeos/login/user_manager.h"
34 #include "chrome/browser/chromeos/proxy_config_service.h" 34 #include "chrome/browser/chromeos/proxy_config_service.h"
35 #include "chrome/browser/extensions/extension_service.h" 35 #include "chrome/browser/extensions/extension_service.h"
36 #include "chrome/browser/net/chrome_url_request_context.h" 36 #include "chrome/browser/net/chrome_url_request_context.h"
37 #include "chrome/browser/net/gaia/token_service.h" 37 #include "chrome/browser/net/gaia/token_service.h"
38 #include "chrome/browser/net/preconnect.h" 38 #include "chrome/browser/net/preconnect.h"
39 #include "chrome/browser/net/pref_proxy_config_service.h" 39 #include "chrome/browser/net/pref_proxy_config_service.h"
40 #include "chrome/browser/plugin_updater.h" 40 #include "chrome/browser/plugin_updater.h"
41 #include "chrome/browser/policy/profile_policy_connector.h"
41 #include "chrome/browser/prefs/pref_member.h" 42 #include "chrome/browser/prefs/pref_member.h"
42 #include "chrome/browser/profiles/profile.h" 43 #include "chrome/browser/profiles/profile.h"
43 #include "chrome/browser/profiles/profile_manager.h" 44 #include "chrome/browser/profiles/profile_manager.h"
44 #include "chrome/browser/sync/profile_sync_service.h" 45 #include "chrome/browser/sync/profile_sync_service.h"
45 #include "chrome/browser/ui/browser_init.h" 46 #include "chrome/browser/ui/browser_init.h"
46 #include "chrome/common/chrome_paths.h" 47 #include "chrome/common/chrome_paths.h"
47 #include "chrome/common/chrome_switches.h" 48 #include "chrome/common/chrome_switches.h"
48 #include "chrome/common/logging_chrome.h" 49 #include "chrome/common/logging_chrome.h"
49 #include "chrome/common/net/gaia/gaia_auth_fetcher.h" 50 #include "chrome/common/net/gaia/gaia_auth_fetcher.h"
50 #include "chrome/common/net/gaia/gaia_constants.h" 51 #include "chrome/common/net/gaia/gaia_constants.h"
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 226
226 // Switch log file as soon as possible. 227 // Switch log file as soon as possible.
227 logging::RedirectChromeLogging(*(CommandLine::ForCurrentProcess())); 228 logging::RedirectChromeLogging(*(CommandLine::ForCurrentProcess()));
228 btl->AddLoginTimeMarker("LoggingRedirected", false); 229 btl->AddLoginTimeMarker("LoggingRedirected", false);
229 230
230 username_ = username; 231 username_ = username;
231 password_ = password; 232 password_ = password;
232 credentials_ = credentials; 233 credentials_ = credentials;
233 pending_requests_ = pending_requests; 234 pending_requests_ = pending_requests;
234 delegate_ = delegate; 235 delegate_ = delegate;
235 236
Mattias Nissler (ping if slow) 2011/05/26 10:20:20 excess newline
sfeuz 2011/05/31 07:32:31 Done.
237
236 // The default profile will have been changed because the ProfileManager 238 // The default profile will have been changed because the ProfileManager
237 // will process the notification that the UserManager sends out. 239 // will process the notification that the UserManager sends out.
238 ProfileManager::CreateDefaultProfileAsync(this); 240 ProfileManager::CreateDefaultProfileAsync(this);
239 } 241 }
240 242
241 void LoginUtilsImpl::OnProfileCreated(Profile* profile) { 243 void LoginUtilsImpl::OnProfileCreated(Profile* profile) {
242 CHECK(profile); 244 CHECK(profile);
243 245
246 // Initialize the userpolicy backend.
247 ProfilePolicyConnector* profile_policy_connector =
248 g_browser_process->user_policy_connector();
249 DCHECK(profile_policy_connector);
Mattias Nissler (ping if slow) 2011/05/26 10:20:20 No need for the DCHECK, we crash anyway below.
sfeuz 2011/05/31 07:32:31 Is that really a reason to remove this DCHECK?
250 profile_policy_connector->Initialize(username_,
Mattias Nissler (ping if slow) 2011/05/26 10:20:20 Once we have the policy wrapper object, we should
251 profile()->GetPath(),
252 profile->GetTokenService());
253
244 BootTimesLoader* btl = BootTimesLoader::Get(); 254 BootTimesLoader* btl = BootTimesLoader::Get();
245 btl->AddLoginTimeMarker("UserProfileGotten", false); 255 btl->AddLoginTimeMarker("UserProfileGotten", false);
246 256
247 bool first_login = !UserManager::Get()->IsKnownUser(username_); 257 bool first_login = !UserManager::Get()->IsKnownUser(username_);
248 // Change the proxy configuration service of the default request context to 258 // Change the proxy configuration service of the default request context to
249 // use the preference configuration from the logged-in profile. This ensures 259 // use the preference configuration from the logged-in profile. This ensures
250 // that requests done through the default context use the proxy configuration 260 // that requests done through the default context use the proxy configuration
251 // provided by configuration policy. 261 // provided by configuration policy.
252 // 262 //
253 // Note: Many of the clients of the default request context should probably be 263 // Note: Many of the clients of the default request context should probably be
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 // Mark login host for deletion after browser starts. This 604 // Mark login host for deletion after browser starts. This
595 // guarantees that the message loop will be referenced by the 605 // guarantees that the message loop will be referenced by the
596 // browser before it is dereferenced by the login host. 606 // browser before it is dereferenced by the login host.
597 if (login_host) { 607 if (login_host) {
598 login_host->OnSessionStart(); 608 login_host->OnSessionStart();
599 login_host = NULL; 609 login_host = NULL;
600 } 610 }
601 } 611 }
602 612
603 } // namespace chromeos 613 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698