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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 } | 541 } |
542 } | 542 } |
543 browser::ShowLoginWizard(first_screen, size); | 543 browser::ShowLoginWizard(first_screen, size); |
544 } else if (parsed_command_line.HasSwitch(switches::kLoginUser) && | 544 } else if (parsed_command_line.HasSwitch(switches::kLoginUser) && |
545 parsed_command_line.HasSwitch(switches::kLoginPassword)) { | 545 parsed_command_line.HasSwitch(switches::kLoginPassword)) { |
546 chromeos::BootTimesLoader::Get()->RecordLoginAttempted(); | 546 chromeos::BootTimesLoader::Get()->RecordLoginAttempted(); |
547 new StubLogin( | 547 new StubLogin( |
548 parsed_command_line.GetSwitchValueASCII(switches::kLoginUser), | 548 parsed_command_line.GetSwitchValueASCII(switches::kLoginUser), |
549 parsed_command_line.GetSwitchValueASCII(switches::kLoginPassword)); | 549 parsed_command_line.GetSwitchValueASCII(switches::kLoginPassword)); |
550 } else { | 550 } else { |
551 // We did not log in (we crashed or are debugging), so we need to | 551 if (!parsed_command_line.HasSwitch(switches::kTestName)) { |
552 // set the user name for sync. | 552 // We did not log in (we crashed or are debugging), so we need to |
553 profile->GetProfileSyncService( | 553 // set the user name for sync. |
554 chromeos::UserManager::Get()->logged_in_user().email()); | 554 chromeos::LoginUtils::Get()->RestoreAuthenticationSession( |
| 555 chromeos::UserManager::Get()->logged_in_user().email(), profile); |
| 556 } |
555 } | 557 } |
556 } | 558 } |
557 | 559 |
558 #else | 560 #else |
559 | 561 |
560 void OptionallyRunChromeOSLoginManager(const CommandLine& parsed_command_line, | 562 void OptionallyRunChromeOSLoginManager(const CommandLine& parsed_command_line, |
561 Profile* profile) { | 563 Profile* profile) { |
562 // Dummy empty function for non-ChromeOS builds to avoid extra ifdefs below. | 564 // Dummy empty function for non-ChromeOS builds to avoid extra ifdefs below. |
563 } | 565 } |
564 | 566 |
(...skipping 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2084 if (env->GetVar(chrome::kPreReadEnvironmentVariable, &pre_read) && | 2086 if (env->GetVar(chrome::kPreReadEnvironmentVariable, &pre_read) && |
2085 (pre_read == "0" || pre_read == "1")) { | 2087 (pre_read == "0" || pre_read == "1")) { |
2086 std::string uma_name(name); | 2088 std::string uma_name(name); |
2087 uma_name += "_PreRead"; | 2089 uma_name += "_PreRead"; |
2088 uma_name += pre_read == "1" ? "Enabled" : "Disabled"; | 2090 uma_name += pre_read == "1" ? "Enabled" : "Disabled"; |
2089 AddPreReadHistogramTime(uma_name.c_str(), time); | 2091 AddPreReadHistogramTime(uma_name.c_str(), time); |
2090 } | 2092 } |
2091 #endif | 2093 #endif |
2092 #endif | 2094 #endif |
2093 } | 2095 } |
OLD | NEW |