OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/session/user_session_manager.h" | 5 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 // Callback to GetNSSCertDatabaseForProfile. It starts CertLoader using the | 196 // Callback to GetNSSCertDatabaseForProfile. It starts CertLoader using the |
197 // provided NSS database. It must be called for primary user only. | 197 // provided NSS database. It must be called for primary user only. |
198 void OnGetNSSCertDatabaseForUser(net::NSSCertDatabase* database) { | 198 void OnGetNSSCertDatabaseForUser(net::NSSCertDatabase* database) { |
199 if (!CertLoader::IsInitialized()) | 199 if (!CertLoader::IsInitialized()) |
200 return; | 200 return; |
201 | 201 |
202 CertLoader::Get()->StartWithNSSDB(database); | 202 CertLoader::Get()->StartWithNSSDB(database); |
203 } | 203 } |
204 | 204 |
205 // Returns new CommandLine with per-user flags. | 205 // Returns new CommandLine with per-user flags. |
206 CommandLine CreatePerSessionCommandLine(Profile* profile) { | 206 base::CommandLine CreatePerSessionCommandLine(Profile* profile) { |
207 CommandLine user_flags(CommandLine::NO_PROGRAM); | 207 base::CommandLine user_flags(base::CommandLine::NO_PROGRAM); |
208 about_flags::PrefServiceFlagsStorage flags_storage_(profile->GetPrefs()); | 208 about_flags::PrefServiceFlagsStorage flags_storage_(profile->GetPrefs()); |
209 about_flags::ConvertFlagsToSwitches(&flags_storage_, &user_flags, | 209 about_flags::ConvertFlagsToSwitches(&flags_storage_, &user_flags, |
210 about_flags::kAddSentinels); | 210 about_flags::kAddSentinels); |
211 return user_flags; | 211 return user_flags; |
212 } | 212 } |
213 | 213 |
214 // Returns true if restart is needed to apply per-session flags. | 214 // Returns true if restart is needed to apply per-session flags. |
215 bool NeedRestartToApplyPerSessionFlags( | 215 bool NeedRestartToApplyPerSessionFlags( |
216 const CommandLine& user_flags, | 216 const base::CommandLine& user_flags, |
217 std::set<CommandLine::StringType>* out_command_line_difference) { | 217 std::set<base::CommandLine::StringType>* out_command_line_difference) { |
218 // Don't restart browser if it is not first profile in session. | 218 // Don't restart browser if it is not first profile in session. |
219 if (user_manager::UserManager::Get()->GetLoggedInUsers().size() != 1) | 219 if (user_manager::UserManager::Get()->GetLoggedInUsers().size() != 1) |
220 return false; | 220 return false; |
221 | 221 |
222 // Only restart if needed and if not going into managed mode. | 222 // Only restart if needed and if not going into managed mode. |
223 if (user_manager::UserManager::Get()->IsLoggedInAsSupervisedUser()) | 223 if (user_manager::UserManager::Get()->IsLoggedInAsSupervisedUser()) |
224 return false; | 224 return false; |
225 | 225 |
226 if (about_flags::AreSwitchesIdenticalToCurrentCommandLine( | 226 if (about_flags::AreSwitchesIdenticalToCurrentCommandLine( |
227 user_flags, *CommandLine::ForCurrentProcess(), | 227 user_flags, *base::CommandLine::ForCurrentProcess(), |
228 out_command_line_difference)) { | 228 out_command_line_difference)) { |
229 return false; | 229 return false; |
230 } | 230 } |
231 | 231 |
232 return true; | 232 return true; |
233 } | 233 } |
234 | 234 |
235 bool CanPerformEarlyRestart() { | 235 bool CanPerformEarlyRestart() { |
236 // Desktop build is used for development only. Early restart is not supported. | 236 // Desktop build is used for development only. Early restart is not supported. |
237 if (!base::SysInfo::IsRunningOnChromeOS()) | 237 if (!base::SysInfo::IsRunningOnChromeOS()) |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 if (user_manager::UserManager::IsInitialized()) | 335 if (user_manager::UserManager::IsInitialized()) |
336 user_manager::UserManager::Get()->RemoveSessionStateObserver(this); | 336 user_manager::UserManager::Get()->RemoveSessionStateObserver(this); |
337 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); | 337 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); |
338 } | 338 } |
339 | 339 |
340 void UserSessionManager::CompleteGuestSessionLogin(const GURL& start_url) { | 340 void UserSessionManager::CompleteGuestSessionLogin(const GURL& start_url) { |
341 VLOG(1) << "Completing guest session login"; | 341 VLOG(1) << "Completing guest session login"; |
342 | 342 |
343 // For guest session we ask session_manager to restart Chrome with --bwsi | 343 // For guest session we ask session_manager to restart Chrome with --bwsi |
344 // flag. We keep only some of the arguments of this process. | 344 // flag. We keep only some of the arguments of this process. |
345 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | 345 const base::CommandLine& browser_command_line = |
346 CommandLine command_line(browser_command_line.GetProgram()); | 346 *base::CommandLine::ForCurrentProcess(); |
| 347 base::CommandLine command_line(browser_command_line.GetProgram()); |
347 std::string cmd_line_str = | 348 std::string cmd_line_str = |
348 GetOffTheRecordCommandLine(start_url, | 349 GetOffTheRecordCommandLine(start_url, |
349 StartupUtils::IsOobeCompleted(), | 350 StartupUtils::IsOobeCompleted(), |
350 browser_command_line, | 351 browser_command_line, |
351 &command_line); | 352 &command_line); |
352 | 353 |
353 // This makes sure that Chrome restarts with no per-session flags. The guest | 354 // This makes sure that Chrome restarts with no per-session flags. The guest |
354 // profile will always have empty set of per-session flags. If this is not | 355 // profile will always have empty set of per-session flags. If this is not |
355 // done and device owner has some per-session flags, when Chrome is relaunched | 356 // done and device owner has some per-session flags, when Chrome is relaunched |
356 // the guest profile session flags will not match the current command line and | 357 // the guest profile session flags will not match the current command line and |
357 // another restart will be attempted in order to reset the user flags for the | 358 // another restart will be attempted in order to reset the user flags for the |
358 // guest user. | 359 // guest user. |
359 const CommandLine user_flags(CommandLine::NO_PROGRAM); | 360 const base::CommandLine user_flags(base::CommandLine::NO_PROGRAM); |
360 if (!about_flags::AreSwitchesIdenticalToCurrentCommandLine( | 361 if (!about_flags::AreSwitchesIdenticalToCurrentCommandLine( |
361 user_flags, | 362 user_flags, *base::CommandLine::ForCurrentProcess(), NULL)) { |
362 *CommandLine::ForCurrentProcess(), | |
363 NULL)) { | |
364 DBusThreadManager::Get()->GetSessionManagerClient()->SetFlagsForUser( | 363 DBusThreadManager::Get()->GetSessionManagerClient()->SetFlagsForUser( |
365 chromeos::login::kGuestUserName, | 364 chromeos::login::kGuestUserName, base::CommandLine::StringVector()); |
366 CommandLine::StringVector()); | |
367 } | 365 } |
368 | 366 |
369 RestartChrome(cmd_line_str); | 367 RestartChrome(cmd_line_str); |
370 } | 368 } |
371 | 369 |
372 void UserSessionManager::StartSession( | 370 void UserSessionManager::StartSession( |
373 const UserContext& user_context, | 371 const UserContext& user_context, |
374 StartSessionType start_session_type, | 372 StartSessionType start_session_type, |
375 scoped_refptr<Authenticator> authenticator, | 373 scoped_refptr<Authenticator> authenticator, |
376 bool has_auth_cookies, | 374 bool has_auth_cookies, |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 | 579 |
582 bool UserSessionManager::RestartToApplyPerSessionFlagsIfNeed( | 580 bool UserSessionManager::RestartToApplyPerSessionFlagsIfNeed( |
583 Profile* profile, | 581 Profile* profile, |
584 bool early_restart) { | 582 bool early_restart) { |
585 if (ProfileHelper::IsSigninProfile(profile)) | 583 if (ProfileHelper::IsSigninProfile(profile)) |
586 return false; | 584 return false; |
587 | 585 |
588 if (early_restart && !CanPerformEarlyRestart()) | 586 if (early_restart && !CanPerformEarlyRestart()) |
589 return false; | 587 return false; |
590 | 588 |
591 const CommandLine user_flags(CreatePerSessionCommandLine(profile)); | 589 const base::CommandLine user_flags(CreatePerSessionCommandLine(profile)); |
592 std::set<CommandLine::StringType> command_line_difference; | 590 std::set<base::CommandLine::StringType> command_line_difference; |
593 if (!NeedRestartToApplyPerSessionFlags(user_flags, &command_line_difference)) | 591 if (!NeedRestartToApplyPerSessionFlags(user_flags, &command_line_difference)) |
594 return false; | 592 return false; |
595 | 593 |
596 LogCustomSwitches(command_line_difference); | 594 LogCustomSwitches(command_line_difference); |
597 | 595 |
598 about_flags::ReportCustomFlags("Login.CustomFlags", command_line_difference); | 596 about_flags::ReportCustomFlags("Login.CustomFlags", command_line_difference); |
599 | 597 |
600 CommandLine::StringVector flags; | 598 CommandLine::StringVector flags; |
601 // argv[0] is the program name |CommandLine::NO_PROGRAM|. | 599 // argv[0] is the program name |base::CommandLine::NO_PROGRAM|. |
602 flags.assign(user_flags.argv().begin() + 1, user_flags.argv().end()); | 600 flags.assign(user_flags.argv().begin() + 1, user_flags.argv().end()); |
603 LOG(WARNING) << "Restarting to apply per-session flags..."; | 601 LOG(WARNING) << "Restarting to apply per-session flags..."; |
604 DBusThreadManager::Get()->GetSessionManagerClient()->SetFlagsForUser( | 602 DBusThreadManager::Get()->GetSessionManagerClient()->SetFlagsForUser( |
605 user_manager::UserManager::Get()->GetActiveUser()->email(), flags); | 603 user_manager::UserManager::Get()->GetActiveUser()->email(), flags); |
606 AttemptRestart(profile); | 604 AttemptRestart(profile); |
607 return true; | 605 return true; |
608 } | 606 } |
609 | 607 |
610 bool UserSessionManager::NeedsToUpdateEasyUnlockKeys() const { | 608 bool UserSessionManager::NeedsToUpdateEasyUnlockKeys() const { |
611 return EasyUnlockService::IsSignInEnabled() && | 609 return EasyUnlockService::IsSignInEnabled() && |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 login_manager->ContinueSessionRestore(); | 719 login_manager->ContinueSessionRestore(); |
722 } else if (should_restore_session) { | 720 } else if (should_restore_session) { |
723 pending_signin_restore_sessions_.erase((*it)->email()); | 721 pending_signin_restore_sessions_.erase((*it)->email()); |
724 RestoreAuthSessionImpl(user_profile, false /* has_auth_cookies */); | 722 RestoreAuthSessionImpl(user_profile, false /* has_auth_cookies */); |
725 } | 723 } |
726 } | 724 } |
727 } | 725 } |
728 | 726 |
729 void UserSessionManager::OnProfilePrepared(Profile* profile, | 727 void UserSessionManager::OnProfilePrepared(Profile* profile, |
730 bool browser_launched) { | 728 bool browser_launched) { |
731 if (!CommandLine::ForCurrentProcess()->HasSwitch(::switches::kTestName)) { | 729 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 730 ::switches::kTestName)) { |
732 // Did not log in (we crashed or are debugging), need to restore Sync. | 731 // Did not log in (we crashed or are debugging), need to restore Sync. |
733 // TODO(nkostylev): Make sure that OAuth state is restored correctly for all | 732 // TODO(nkostylev): Make sure that OAuth state is restored correctly for all |
734 // users once it is fully multi-profile aware. http://crbug.com/238987 | 733 // users once it is fully multi-profile aware. http://crbug.com/238987 |
735 // For now if we have other user pending sessions they'll override OAuth | 734 // For now if we have other user pending sessions they'll override OAuth |
736 // session restore for previous users. | 735 // session restore for previous users. |
737 RestoreAuthenticationSession(profile); | 736 RestoreAuthenticationSession(profile); |
738 } | 737 } |
739 | 738 |
740 // Restore other user sessions if any. | 739 // Restore other user sessions if any. |
741 RestorePendingUserSessions(); | 740 RestorePendingUserSessions(); |
742 } | 741 } |
743 | 742 |
744 void UserSessionManager::CreateUserSession(const UserContext& user_context, | 743 void UserSessionManager::CreateUserSession(const UserContext& user_context, |
745 bool has_auth_cookies) { | 744 bool has_auth_cookies) { |
746 user_context_ = user_context; | 745 user_context_ = user_context; |
747 has_auth_cookies_ = has_auth_cookies; | 746 has_auth_cookies_ = has_auth_cookies; |
748 InitSessionRestoreStrategy(); | 747 InitSessionRestoreStrategy(); |
749 } | 748 } |
750 | 749 |
751 void UserSessionManager::PreStartSession() { | 750 void UserSessionManager::PreStartSession() { |
752 // Switch log file as soon as possible. | 751 // Switch log file as soon as possible. |
753 if (base::SysInfo::IsRunningOnChromeOS()) | 752 if (base::SysInfo::IsRunningOnChromeOS()) |
754 logging::RedirectChromeLogging(*(CommandLine::ForCurrentProcess())); | 753 logging::RedirectChromeLogging(*(base::CommandLine::ForCurrentProcess())); |
755 } | 754 } |
756 | 755 |
757 void UserSessionManager::StartCrosSession() { | 756 void UserSessionManager::StartCrosSession() { |
758 BootTimesLoader* btl = BootTimesLoader::Get(); | 757 BootTimesLoader* btl = BootTimesLoader::Get(); |
759 btl->AddLoginTimeMarker("StartSession-Start", false); | 758 btl->AddLoginTimeMarker("StartSession-Start", false); |
760 DBusThreadManager::Get()->GetSessionManagerClient()-> | 759 DBusThreadManager::Get()->GetSessionManagerClient()-> |
761 StartSession(user_context_.GetUserID()); | 760 StartSession(user_context_.GetUserID()); |
762 btl->AddLoginTimeMarker("StartSession-End", false); | 761 btl->AddLoginTimeMarker("StartSession-End", false); |
763 } | 762 } |
764 | 763 |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 } | 1017 } |
1019 } | 1018 } |
1020 | 1019 |
1021 // Only show getting started guide for a new user. | 1020 // Only show getting started guide for a new user. |
1022 const bool should_show_getstarted_guide = user_manager->IsCurrentUserNew(); | 1021 const bool should_show_getstarted_guide = user_manager->IsCurrentUserNew(); |
1023 | 1022 |
1024 if (can_show_getstarted_guide && should_show_getstarted_guide) { | 1023 if (can_show_getstarted_guide && should_show_getstarted_guide) { |
1025 // Don't open default Chrome window if we're going to launch the first-run | 1024 // Don't open default Chrome window if we're going to launch the first-run |
1026 // app. Because we dont' want the first-run app to be hidden in the | 1025 // app. Because we dont' want the first-run app to be hidden in the |
1027 // background. | 1026 // background. |
1028 CommandLine::ForCurrentProcess()->AppendSwitch(::switches::kSilentLaunch); | 1027 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 1028 ::switches::kSilentLaunch); |
1029 first_run::MaybeLaunchDialogAfterSessionStart(); | 1029 first_run::MaybeLaunchDialogAfterSessionStart(); |
1030 } else { | 1030 } else { |
1031 for (size_t i = 0; i < start_urls.size(); ++i) { | 1031 for (size_t i = 0; i < start_urls.size(); ++i) { |
1032 CommandLine::ForCurrentProcess()->AppendArg(start_urls[i]); | 1032 base::CommandLine::ForCurrentProcess()->AppendArg(start_urls[i]); |
1033 } | 1033 } |
1034 } | 1034 } |
1035 } | 1035 } |
1036 | 1036 |
1037 bool UserSessionManager::InitializeUserSession(Profile* profile) { | 1037 bool UserSessionManager::InitializeUserSession(Profile* profile) { |
1038 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); | 1038 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); |
1039 | 1039 |
1040 // Kiosk apps has their own session initialization pipeline. | 1040 // Kiosk apps has their own session initialization pipeline. |
1041 if (user_manager->IsLoggedInAsKioskApp()) | 1041 if (user_manager->IsLoggedInAsKioskApp()) |
1042 return false; | 1042 return false; |
1043 | 1043 |
1044 if (start_session_type_ == PRIMARY_USER_SESSION) { | 1044 if (start_session_type_ == PRIMARY_USER_SESSION) { |
1045 UserFlow* user_flow = ChromeUserManager::Get()->GetCurrentUserFlow(); | 1045 UserFlow* user_flow = ChromeUserManager::Get()->GetCurrentUserFlow(); |
1046 WizardController* oobe_controller = WizardController::default_controller(); | 1046 WizardController* oobe_controller = WizardController::default_controller(); |
1047 base::CommandLine* cmdline = CommandLine::ForCurrentProcess(); | 1047 base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess(); |
1048 bool skip_post_login_screens = | 1048 bool skip_post_login_screens = |
1049 user_flow->ShouldSkipPostLoginScreens() || | 1049 user_flow->ShouldSkipPostLoginScreens() || |
1050 (oobe_controller && oobe_controller->skip_post_login_screens()) || | 1050 (oobe_controller && oobe_controller->skip_post_login_screens()) || |
1051 cmdline->HasSwitch(chromeos::switches::kOobeSkipPostLogin); | 1051 cmdline->HasSwitch(chromeos::switches::kOobeSkipPostLogin); |
1052 | 1052 |
1053 if (user_manager->IsCurrentUserNew() && !skip_post_login_screens) { | 1053 if (user_manager->IsCurrentUserNew() && !skip_post_login_screens) { |
1054 // Don't specify start URLs if the administrator has configured the start | 1054 // Don't specify start URLs if the administrator has configured the start |
1055 // URLs via policy. | 1055 // URLs via policy. |
1056 if (!SessionStartupPref::TypeIsManaged(profile->GetPrefs())) | 1056 if (!SessionStartupPref::TypeIsManaged(profile->GetPrefs())) |
1057 InitializeStartUrls(); | 1057 InitializeStartUrls(); |
1058 | 1058 |
1059 // Mark the device as registered., i.e. the second part of OOBE as | 1059 // Mark the device as registered., i.e. the second part of OOBE as |
1060 // completed. | 1060 // completed. |
1061 if (!StartupUtils::IsDeviceRegistered()) | 1061 if (!StartupUtils::IsDeviceRegistered()) |
1062 StartupUtils::MarkDeviceRegistered(base::Closure()); | 1062 StartupUtils::MarkDeviceRegistered(base::Closure()); |
1063 | 1063 |
1064 ActivateWizard(WizardController::kTermsOfServiceScreenName); | 1064 ActivateWizard(WizardController::kTermsOfServiceScreenName); |
1065 return false; | 1065 return false; |
1066 } | 1066 } |
1067 } | 1067 } |
1068 | 1068 |
1069 LoginUtils::Get()->DoBrowserLaunch(profile, | 1069 LoginUtils::Get()->DoBrowserLaunch(profile, |
1070 LoginDisplayHostImpl::default_host()); | 1070 LoginDisplayHostImpl::default_host()); |
1071 return true; | 1071 return true; |
1072 } | 1072 } |
1073 | 1073 |
1074 void UserSessionManager::InitSessionRestoreStrategy() { | 1074 void UserSessionManager::InitSessionRestoreStrategy() { |
1075 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 1075 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
1076 bool in_app_mode = chrome::IsRunningInForcedAppMode(); | 1076 bool in_app_mode = chrome::IsRunningInForcedAppMode(); |
1077 | 1077 |
1078 // Are we in kiosk app mode? | 1078 // Are we in kiosk app mode? |
1079 if (in_app_mode) { | 1079 if (in_app_mode) { |
1080 if (command_line->HasSwitch(::switches::kAppModeOAuth2Token)) { | 1080 if (command_line->HasSwitch(::switches::kAppModeOAuth2Token)) { |
1081 oauth2_refresh_token_ = command_line->GetSwitchValueASCII( | 1081 oauth2_refresh_token_ = command_line->GetSwitchValueASCII( |
1082 ::switches::kAppModeOAuth2Token); | 1082 ::switches::kAppModeOAuth2Token); |
1083 } | 1083 } |
1084 | 1084 |
1085 if (command_line->HasSwitch(::switches::kAppModeAuthCode)) { | 1085 if (command_line->HasSwitch(::switches::kAppModeAuthCode)) { |
(...skipping 24 matching lines...) Expand all Loading... |
1110 } | 1110 } |
1111 } | 1111 } |
1112 | 1112 |
1113 void UserSessionManager::RestoreAuthSessionImpl( | 1113 void UserSessionManager::RestoreAuthSessionImpl( |
1114 Profile* profile, | 1114 Profile* profile, |
1115 bool restore_from_auth_cookies) { | 1115 bool restore_from_auth_cookies) { |
1116 CHECK((authenticator_.get() && authenticator_->authentication_context()) || | 1116 CHECK((authenticator_.get() && authenticator_->authentication_context()) || |
1117 !restore_from_auth_cookies); | 1117 !restore_from_auth_cookies); |
1118 | 1118 |
1119 if (chrome::IsRunningInForcedAppMode() || | 1119 if (chrome::IsRunningInForcedAppMode() || |
1120 CommandLine::ForCurrentProcess()->HasSwitch( | 1120 base::CommandLine::ForCurrentProcess()->HasSwitch( |
1121 chromeos::switches::kDisableGaiaServices)) { | 1121 chromeos::switches::kDisableGaiaServices)) { |
1122 return; | 1122 return; |
1123 } | 1123 } |
1124 | 1124 |
1125 exit_after_session_restore_ = false; | 1125 exit_after_session_restore_ = false; |
1126 | 1126 |
1127 // Remove legacy OAuth1 token if we have one. If it's valid, we should already | 1127 // Remove legacy OAuth1 token if we have one. If it's valid, we should already |
1128 // have OAuth2 refresh token in OAuth2TokenService that could be used to | 1128 // have OAuth2 refresh token in OAuth2TokenService that could be used to |
1129 // retrieve all other tokens and user_context. | 1129 // retrieve all other tokens and user_context. |
1130 OAuth2LoginManager* login_manager = | 1130 OAuth2LoginManager* login_manager = |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1432 #if defined(USE_ATHENA) | 1432 #if defined(USE_ATHENA) |
1433 athena::StartAthenaSessionWithContext(profile); | 1433 athena::StartAthenaSessionWithContext(profile); |
1434 #else | 1434 #else |
1435 StartupBrowserCreator browser_creator; | 1435 StartupBrowserCreator browser_creator; |
1436 int return_code; | 1436 int return_code; |
1437 chrome::startup::IsFirstRun first_run = | 1437 chrome::startup::IsFirstRun first_run = |
1438 ::first_run::IsChromeFirstRun() ? chrome::startup::IS_FIRST_RUN | 1438 ::first_run::IsChromeFirstRun() ? chrome::startup::IS_FIRST_RUN |
1439 : chrome::startup::IS_NOT_FIRST_RUN; | 1439 : chrome::startup::IS_NOT_FIRST_RUN; |
1440 | 1440 |
1441 browser_creator.LaunchBrowser( | 1441 browser_creator.LaunchBrowser( |
1442 *CommandLine::ForCurrentProcess(), profile, base::FilePath(), | 1442 *base::CommandLine::ForCurrentProcess(), profile, base::FilePath(), |
1443 chrome::startup::IS_PROCESS_STARTUP, first_run, &return_code); | 1443 chrome::startup::IS_PROCESS_STARTUP, first_run, &return_code); |
1444 | 1444 |
1445 // Triggers app launcher start page service to load start page web contents. | 1445 // Triggers app launcher start page service to load start page web contents. |
1446 app_list::StartPageService::Get(profile); | 1446 app_list::StartPageService::Get(profile); |
1447 #endif | 1447 #endif |
1448 | 1448 |
1449 // Mark login host for deletion after browser starts. This | 1449 // Mark login host for deletion after browser starts. This |
1450 // guarantees that the message loop will be referenced by the | 1450 // guarantees that the message loop will be referenced by the |
1451 // browser before it is dereferenced by the login host. | 1451 // browser before it is dereferenced by the login host. |
1452 if (login_host) | 1452 if (login_host) |
(...skipping 26 matching lines...) Expand all Loading... |
1479 InputEventsBlocker* /* input_events_blocker */, | 1479 InputEventsBlocker* /* input_events_blocker */, |
1480 const locale_util::LanguageSwitchResult& /* result */) { | 1480 const locale_util::LanguageSwitchResult& /* result */) { |
1481 callback.Run(); | 1481 callback.Run(); |
1482 } | 1482 } |
1483 | 1483 |
1484 void UserSessionManager::RemoveProfileForTesting(Profile* profile) { | 1484 void UserSessionManager::RemoveProfileForTesting(Profile* profile) { |
1485 default_ime_states_.erase(profile); | 1485 default_ime_states_.erase(profile); |
1486 } | 1486 } |
1487 | 1487 |
1488 } // namespace chromeos | 1488 } // namespace chromeos |
OLD | NEW |