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/chrome_browser_main.h" | 5 #include "chrome/browser/chrome_browser_main.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 | 497 |
498 void OnLoginSuccess(const std::string& username, | 498 void OnLoginSuccess(const std::string& username, |
499 const std::string& password, | 499 const std::string& password, |
500 const GaiaAuthConsumer::ClientLoginResult& credentials, | 500 const GaiaAuthConsumer::ClientLoginResult& credentials, |
501 bool pending_requests, | 501 bool pending_requests, |
502 bool using_oauth) { | 502 bool using_oauth) { |
503 pending_requests_ = pending_requests; | 503 pending_requests_ = pending_requests; |
504 if (!profile_prepared_) { | 504 if (!profile_prepared_) { |
505 // Will call OnProfilePrepared in the end. | 505 // Will call OnProfilePrepared in the end. |
506 chromeos::LoginUtils::Get()->PrepareProfile(username, | 506 chromeos::LoginUtils::Get()->PrepareProfile(username, |
| 507 std::string(), |
507 password, | 508 password, |
508 credentials, | 509 credentials, |
509 pending_requests, | 510 pending_requests, |
510 using_oauth, | 511 using_oauth, |
511 false, | 512 false, |
512 this); | 513 this); |
513 } else if (!pending_requests) { | 514 } else if (!pending_requests) { |
514 delete this; | 515 delete this; |
515 } | 516 } |
516 } | 517 } |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 browser::ShowLoginWizard(first_screen, size); | 553 browser::ShowLoginWizard(first_screen, size); |
553 } else if (parsed_command_line.HasSwitch(switches::kLoginUser) && | 554 } else if (parsed_command_line.HasSwitch(switches::kLoginUser) && |
554 parsed_command_line.HasSwitch(switches::kLoginPassword)) { | 555 parsed_command_line.HasSwitch(switches::kLoginPassword)) { |
555 chromeos::BootTimesLoader::Get()->RecordLoginAttempted(); | 556 chromeos::BootTimesLoader::Get()->RecordLoginAttempted(); |
556 new StubLogin( | 557 new StubLogin( |
557 parsed_command_line.GetSwitchValueASCII(switches::kLoginUser), | 558 parsed_command_line.GetSwitchValueASCII(switches::kLoginUser), |
558 parsed_command_line.GetSwitchValueASCII(switches::kLoginPassword)); | 559 parsed_command_line.GetSwitchValueASCII(switches::kLoginPassword)); |
559 } else { | 560 } else { |
560 if (!parsed_command_line.HasSwitch(switches::kTestName)) { | 561 if (!parsed_command_line.HasSwitch(switches::kTestName)) { |
561 // We did not log in (we crashed or are debugging), so we need to | 562 // We did not log in (we crashed or are debugging), so we need to |
562 // set the user name for sync. | 563 // restore Sync. |
563 chromeos::LoginUtils::Get()->RestoreAuthenticationSession( | 564 chromeos::LoginUtils::Get()->RestoreAuthenticationSession(profile); |
564 chromeos::UserManager::Get()->logged_in_user().email(), profile); | |
565 } | 565 } |
566 } | 566 } |
567 } | 567 } |
568 | 568 |
569 #endif // defined(OS_CHROMEOS) | 569 #endif // defined(OS_CHROMEOS) |
570 | 570 |
571 #if defined(OS_MACOSX) | 571 #if defined(OS_MACOSX) |
572 OSStatus KeychainCallback(SecKeychainEvent keychain_event, | 572 OSStatus KeychainCallback(SecKeychainEvent keychain_event, |
573 SecKeychainCallbackInfo *info, void *context) { | 573 SecKeychainCallbackInfo *info, void *context) { |
574 return noErr; | 574 return noErr; |
(...skipping 1580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2155 if (env->GetVar(chrome::kPreReadEnvironmentVariable, &pre_read) && | 2155 if (env->GetVar(chrome::kPreReadEnvironmentVariable, &pre_read) && |
2156 (pre_read == "0" || pre_read == "1")) { | 2156 (pre_read == "0" || pre_read == "1")) { |
2157 std::string uma_name(name); | 2157 std::string uma_name(name); |
2158 uma_name += "_PreRead"; | 2158 uma_name += "_PreRead"; |
2159 uma_name += pre_read == "1" ? "Enabled" : "Disabled"; | 2159 uma_name += pre_read == "1" ? "Enabled" : "Disabled"; |
2160 AddPreReadHistogramTime(uma_name.c_str(), time); | 2160 AddPreReadHistogramTime(uma_name.c_str(), time); |
2161 } | 2161 } |
2162 #endif | 2162 #endif |
2163 #endif | 2163 #endif |
2164 } | 2164 } |
OLD | NEW |