OLD | NEW |
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 Loading... |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |