Commit 286251e8 authored by Anatoliy Potapchuk's avatar Anatoliy Potapchuk Committed by Commit Bot

Start PWA session before opening the app

We should notify SessionManager before we actually create a new browser
window. This is needed to cover one of the bugs related to the splash
screen.

Bug: 1006230, 939674
Change-Id: I3e7e8b5b639dd1bfec2483869959a50b0acb2053
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1912360Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Commit-Queue: Anatoliy Potapchuk <apotapchuk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715675}
parent df73695a
......@@ -152,6 +152,11 @@ void WebKioskController::OnProfilePrepared(Profile* profile,
// Reset virtual keyboard to use IME engines in app profile early.
ChromeKeyboardControllerClient::Get()->RebuildKeyboardIfEnabled();
// We need to change the session state so we are able to create browser
// windows.
session_manager::SessionManager::Get()->SetSessionState(
session_manager::SessionState::LOGGED_IN_NOT_ACTIVE);
app_launcher_.reset(new WebKioskAppLauncher(profile, this));
app_launcher_->Initialize(account_id_);
}
......@@ -187,8 +192,6 @@ void WebKioskController::OnAppPrepared() {
}
void WebKioskController::OnAppLaunched() {
// If timer is running, do not remove splash screen for a few
// more seconds to give the user ability to exit Web kiosk.
SYSLOG(INFO) << "Kiosk launch succeeded, wait for app window.";
session_manager::SessionManager::Get()->SessionStarted();
CloseSplashScreen();
......
......@@ -314,8 +314,7 @@ bool IsOnKioskSplashScreen() {
if (!user_manager::UserManager::IsInitialized())
return false;
user_manager::UserManager* user_manager = user_manager::UserManager::Get();
if (!user_manager->IsLoggedInAsKioskApp() &&
!user_manager->IsLoggedInAsArcKioskApp())
if (!user_manager->IsLoggedInAsAnyKioskApp())
return false;
if (session_manager->session_state() !=
session_manager::SessionState::LOGIN_PRIMARY)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment