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

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

Issue 7049002: Move the check to detect first login before adding the User to the UserManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code Review Fix 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 // will process the notification that the UserManager sends out. 237 // will process the notification that the UserManager sends out.
238 ProfileManager::CreateDefaultProfileAsync(this); 238 ProfileManager::CreateDefaultProfileAsync(this);
239 } 239 }
240 240
241 void LoginUtilsImpl::OnProfileCreated(Profile* profile) { 241 void LoginUtilsImpl::OnProfileCreated(Profile* profile) {
242 CHECK(profile); 242 CHECK(profile);
243 243
244 BootTimesLoader* btl = BootTimesLoader::Get(); 244 BootTimesLoader* btl = BootTimesLoader::Get();
245 btl->AddLoginTimeMarker("UserProfileGotten", false); 245 btl->AddLoginTimeMarker("UserProfileGotten", false);
246 246
247 bool first_login = !UserManager::Get()->IsKnownUser(username_);
248 // Change the proxy configuration service of the default request context to 247 // Change the proxy configuration service of the default request context to
249 // use the preference configuration from the logged-in profile. This ensures 248 // use the preference configuration from the logged-in profile. This ensures
250 // that requests done through the default context use the proxy configuration 249 // that requests done through the default context use the proxy configuration
251 // provided by configuration policy. 250 // provided by configuration policy.
252 // 251 //
253 // Note: Many of the clients of the default request context should probably be 252 // Note: Many of the clients of the default request context should probably be
254 // fixed to use the request context of the profile they are associated with. 253 // fixed to use the request context of the profile they are associated with.
255 // This includes preconnect, autofill, metrics service to only name a few; 254 // This includes preconnect, autofill, metrics service to only name a few;
256 // see http://code.google.com/p/chromium/issues/detail?id=64339 for details. 255 // see http://code.google.com/p/chromium/issues/detail?id=64339 for details.
257 // 256 //
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 cryptohome->TpmClearStoredPassword(); 312 cryptohome->TpmClearStoredPassword();
314 } else { 313 } else {
315 cryptohome->TpmCanAttemptOwnership(); 314 cryptohome->TpmCanAttemptOwnership();
316 } 315 }
317 } 316 }
318 } 317 }
319 btl->AddLoginTimeMarker("TPMOwned", false); 318 btl->AddLoginTimeMarker("TPMOwned", false);
320 319
321 RespectLocalePreference(profile); 320 RespectLocalePreference(profile);
322 321
323 if (first_login) { 322 if (UserManager::Get()->current_user_is_new()) {
324 SetFirstLoginPrefs(profile->GetPrefs()); 323 SetFirstLoginPrefs(profile->GetPrefs());
325 } 324 }
326 325
327 // Enable/disable plugins based on user preferences. 326 // Enable/disable plugins based on user preferences.
328 PluginUpdater::GetInstance()->SetProfile(profile); 327 PluginUpdater::GetInstance()->SetProfile(profile);
329 btl->AddLoginTimeMarker("PluginsStateUpdated", false); 328 btl->AddLoginTimeMarker("PluginsStateUpdated", false);
330 329
331 // We suck. This is a hack since we do not have the enterprise feature 330 // We suck. This is a hack since we do not have the enterprise feature
332 // done yet to pull down policies from the domain admin. We'll take this 331 // done yet to pull down policies from the domain admin. We'll take this
333 // out when we get that done properly. 332 // out when we get that done properly.
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 // Mark login host for deletion after browser starts. This 593 // Mark login host for deletion after browser starts. This
595 // guarantees that the message loop will be referenced by the 594 // guarantees that the message loop will be referenced by the
596 // browser before it is dereferenced by the login host. 595 // browser before it is dereferenced by the login host.
597 if (login_host) { 596 if (login_host) {
598 login_host->OnSessionStart(); 597 login_host->OnSessionStart();
599 login_host = NULL; 598 login_host = NULL;
600 } 599 }
601 } 600 }
602 601
603 } // namespace chromeos 602 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698