| Index: chrome/browser/chromeos/login/login_display_host_impl.cc
|
| diff --git a/chrome/browser/chromeos/login/login_display_host_impl.cc b/chrome/browser/chromeos/login/login_display_host_impl.cc
|
| index 1a9cb251da1b058e80095247dee7965e39a39341..c79abfb31154883b7a6f04fd72b464c0af9c9d47 100644
|
| --- a/chrome/browser/chromeos/login/login_display_host_impl.cc
|
| +++ b/chrome/browser/chromeos/login/login_display_host_impl.cc
|
| @@ -82,10 +82,13 @@
|
| namespace {
|
|
|
| // URL which corresponds to the login WebUI.
|
| -const char kLoginURL[] = "chrome://oobe/login";
|
| +const char kLoginURL[] = "chrome://oobe/login#login";
|
|
|
| // URL which corresponds to the OOBE WebUI.
|
| -const char kOobeURL[] = "chrome://oobe";
|
| +const char kOobeURL[] = "chrome://oobe#login";
|
| +
|
| +// URL which corresponds to the user adding WebUI.
|
| +const char kUserAddingURL[] = "chrome://oobe/login#user-adding";
|
|
|
| // Duration of sign-in transition animation.
|
| const int kLoginFadeoutTransitionDurationMs = 700;
|
| @@ -301,7 +304,7 @@ void LoginDisplayHostImpl::BeforeSessionStart() {
|
| session_starting_ = true;
|
| }
|
|
|
| -void LoginDisplayHostImpl::OnSessionStart() {
|
| +void LoginDisplayHostImpl::Finalize() {
|
| DVLOG(1) << "Session starting";
|
| ash::Shell::GetInstance()->
|
| desktop_background_controller()->MoveDesktopToUnlockedContainer();
|
| @@ -309,9 +312,11 @@ void LoginDisplayHostImpl::OnSessionStart() {
|
| wizard_controller_->OnSessionStart();
|
| g_browser_process->platform_part()->profile_helper()->ClearSigninProfile(
|
| base::Closure());
|
| - // Display host is deleted once animation is completed
|
| - // since sign in screen widget has to stay alive.
|
| - StartAnimation();
|
| + if (!IsRunningUserAdding()) {
|
| + // Display host is deleted once animation is completed
|
| + // since sign in screen widget has to stay alive.
|
| + StartAnimation();
|
| + }
|
| ShutdownDisplayHost(false);
|
| }
|
|
|
| @@ -396,6 +401,34 @@ WizardController* LoginDisplayHostImpl::GetWizardController() {
|
| return wizard_controller_.get();
|
| }
|
|
|
| +void LoginDisplayHostImpl::StartUserAdding(
|
| + const base::Closure& completion_callback) {
|
| + restore_path_ = RESTORE_ADD_USER_INTO_SESSION;
|
| + completion_callback_ = completion_callback;
|
| + LOG(INFO) << "Login WebUI >> user adding";
|
| + if (!login_window_)
|
| + LoadURL(GURL(kUserAddingURL));
|
| +
|
| + // Lock container can be transparent after lock screen animation.
|
| + aura::Window* lock_container = ash::Shell::GetContainer(
|
| + ash::Shell::GetPrimaryRootWindow(),
|
| + ash::internal::kShellWindowId_LockScreenContainersContainer);
|
| + lock_container->layer()->SetOpacity(1.0);
|
| +
|
| + ash::Shell::GetInstance()->
|
| + desktop_background_controller()->MoveDesktopToLockedContainer();
|
| +
|
| + sign_in_controller_.reset(); // Only one controller in a time.
|
| + sign_in_controller_.reset(new chromeos::ExistingUserController(this));
|
| + SetOobeProgressBarVisible(oobe_progress_bar_visible_ = false);
|
| + SetStatusAreaVisible(true);
|
| + SetShutdownButtonEnabled(true);
|
| + sign_in_controller_->Init(
|
| + chromeos::UserManager::Get()->GetUsersAdmittedForMultiProfile());
|
| + CHECK(webui_login_display_);
|
| + GetOobeUI()->ShowSigninScreen(webui_login_display_, webui_login_display_);
|
| +}
|
| +
|
| void LoginDisplayHostImpl::StartSignInScreen() {
|
| restore_path_ = RESTORE_SIGN_IN;
|
| is_showing_login_ = true;
|
| @@ -587,6 +620,9 @@ void LoginDisplayHostImpl::ShutdownDisplayHost(bool post_quit_task) {
|
| base::MessageLoop::current()->DeleteSoon(FROM_HERE, this);
|
| if (post_quit_task)
|
| base::MessageLoop::current()->Quit();
|
| +
|
| + if (!completion_callback_.is_null())
|
| + completion_callback_.Run();
|
| }
|
|
|
| void LoginDisplayHostImpl::StartAnimation() {
|
| @@ -693,6 +729,9 @@ void LoginDisplayHostImpl::StartPostponedWebUI() {
|
| case RESTORE_SIGN_IN:
|
| StartSignInScreen();
|
| break;
|
| + case RESTORE_ADD_USER_INTO_SESSION:
|
| + StartUserAdding(completion_callback_);
|
| + break;
|
| default:
|
| NOTREACHED();
|
| break;
|
| @@ -769,6 +808,10 @@ void LoginDisplayHostImpl::ResetLoginWindowAndView() {
|
| login_view_ = NULL;
|
| }
|
|
|
| +bool LoginDisplayHostImpl::IsRunningUserAdding() {
|
| + return restore_path_ == RESTORE_ADD_USER_INTO_SESSION;
|
| +}
|
| +
|
| ////////////////////////////////////////////////////////////////////////////////
|
| // external
|
|
|
| @@ -831,8 +874,8 @@ void ShowLoginWizard(const std::string& first_screen_name) {
|
| (first_screen_name.empty() && oobe_complete) ||
|
| first_screen_name == chromeos::WizardController::kLoginScreenName;
|
|
|
| - chromeos::LoginDisplayHost* display_host;
|
| - display_host = new chromeos::LoginDisplayHostImpl(screen_bounds);
|
| + chromeos::LoginDisplayHost* display_host =
|
| + new chromeos::LoginDisplayHostImpl(screen_bounds);
|
|
|
| if (show_login_screen) {
|
| // R11 > R12 migration fix. See http://crosbug.com/p/4898.
|
|
|