Chromium Code Reviews| 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 34c254f57a0d5b8275bb625fef986a0f0fb73728..470bf4240f2164ed37408db3289a00d0ac551daf 100644 |
| --- a/chrome/browser/chromeos/login/login_display_host_impl.cc |
| +++ b/chrome/browser/chromeos/login/login_display_host_impl.cc |
| @@ -83,10 +83,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; |
| @@ -306,7 +309,7 @@ void LoginDisplayHostImpl::BeforeSessionStart() { |
| session_starting_ = true; |
| } |
| -void LoginDisplayHostImpl::OnSessionStart() { |
| +void LoginDisplayHostImpl::Finalize() { |
| DVLOG(1) << "Session starting"; |
| ash::Shell::GetInstance()-> |
| desktop_background_controller()->MoveDesktopToUnlockedContainer(); |
| @@ -314,9 +317,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); |
| } |
| @@ -401,6 +406,39 @@ WizardController* LoginDisplayHostImpl::GetWizardController() { |
| return wizard_controller_.get(); |
| } |
| +void LoginDisplayHostImpl::StartUserAdding( |
| + const base::Closure& completion_callback) { |
| + restore_path_ = RESTORE_USER_ADDING; |
| + completion_callback_ = completion_callback; |
| + if (waiting_for_wallpaper_load_ && !initialize_webui_hidden_) { |
|
Nikita (slow)
2013/05/28 11:34:22
Please remove this as I think that is not needed f
dzhioev (left Google)
2013/05/29 13:05:04
Done.
|
| + LOG(INFO) << "Login WebUI >> user adding postponed"; |
| + return; |
| + } |
| + LOG(INFO) << "Login WebUI >> user adding"; |
| + if (!login_window_) { |
| + LoadURL(GURL(kUserAddingURL)); |
| + } |
|
Nikita (slow)
2013/05/28 11:34:22
nit: drop {}
dzhioev (left Google)
2013/05/29 13:05:04
Done.
|
| + |
| + // 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; |
| @@ -592,6 +630,10 @@ void LoginDisplayHostImpl::ShutdownDisplayHost(bool post_quit_task) { |
| MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
| if (post_quit_task) |
| MessageLoop::current()->Quit(); |
| + |
| + if (!completion_callback_.is_null()) { |
|
Nikita (slow)
2013/05/28 11:34:22
nit: drop {}
dzhioev (left Google)
2013/05/29 13:05:04
Done.
|
| + completion_callback_.Run(); |
| + } |
| } |
| void LoginDisplayHostImpl::StartAnimation() { |
| @@ -698,6 +740,9 @@ void LoginDisplayHostImpl::StartPostponedWebUI() { |
| case RESTORE_SIGN_IN: |
| StartSignInScreen(); |
| break; |
| + case RESTORE_USER_ADDING: |
| + StartUserAdding(completion_callback_); |
| + break; |
| default: |
| NOTREACHED(); |
| break; |
| @@ -774,6 +819,10 @@ void LoginDisplayHostImpl::ResetLoginWindowAndView() { |
| login_view_ = NULL; |
| } |
| +bool LoginDisplayHostImpl::IsRunningUserAdding() { |
| + return restore_path_ == RESTORE_USER_ADDING; |
| +} |
| + |
| //////////////////////////////////////////////////////////////////////////////// |
| // external |
| @@ -837,8 +886,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. |