Commit 35da0015 authored by Anatoliy Potapchuk's avatar Anatoliy Potapchuk Committed by Commit Bot

[Kiosk] Refactor out ArcKioskSplashScreen

Here we remove redundant ArcKioskSplashScreen, which had the same
functionality as AppLaunchSplashScreen, which ArcKioskController is
now using.

Also, now the splash screen of the arc kiosk properly displays the data
about the app. Also, this CL fixes a bug about not properly caching
the title and the icon of the arc kiosk app.

Bug: 1043663
Change-Id: I81c6a30021097041bd55a3a7182943fe9f93f3e5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2007824
Commit-Queue: Anatoliy Potapchuk <apotapchuk@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Reviewed-by: default avatarSergey Poromov <poromov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#733960}
parent 0fdf70f4
...@@ -86,11 +86,11 @@ void ArcKioskAppManager::GetAppsForTesting( ...@@ -86,11 +86,11 @@ void ArcKioskAppManager::GetAppsForTesting(
} }
} }
void ArcKioskAppManager::UpdateNameAndIcon(const std::string& app_id, void ArcKioskAppManager::UpdateNameAndIcon(const AccountId& account_id,
const std::string& name, const std::string& name,
const gfx::ImageSkia& icon) { const gfx::ImageSkia& icon) {
for (auto& app : apps_) { for (auto& app : apps_) {
if (app->app_id() == app_id) { if (app->account_id() == account_id) {
app->SetCache(name, icon); app->SetCache(name, icon);
return; return;
} }
......
...@@ -42,7 +42,7 @@ class ArcKioskAppManager : public KioskAppManagerBase { ...@@ -42,7 +42,7 @@ class ArcKioskAppManager : public KioskAppManagerBase {
// KioskAppManagerBase: // KioskAppManagerBase:
void GetApps(std::vector<App>* apps) const override; void GetApps(std::vector<App>* apps) const override;
void UpdateNameAndIcon(const std::string& app_id, void UpdateNameAndIcon(const AccountId& account_id,
const std::string& name, const std::string& name,
const gfx::ImageSkia& icon); const gfx::ImageSkia& icon);
......
...@@ -128,8 +128,10 @@ void ArcKioskAppService::OnIconUpdated(ArcAppIcon* icon) { ...@@ -128,8 +128,10 @@ void ArcKioskAppService::OnIconUpdated(ArcAppIcon* icon) {
app_icon_.release(); app_icon_.release();
return; return;
} }
app_manager_->UpdateNameAndIcon(app_id_, app_info_->name, AccountId account_id = multi_user_util::GetAccountIdFromProfile(profile_);
app_manager_->UpdateNameAndIcon(account_id, app_info_->name,
app_icon_->image_skia()); app_icon_->image_skia());
delegate_->OnAppDataUpdated();
} }
void ArcKioskAppService::OnArcSessionRestarting() { void ArcKioskAppService::OnArcSessionRestarting() {
...@@ -217,6 +219,7 @@ void ArcKioskAppService::PreconditionsChanged() { ...@@ -217,6 +219,7 @@ void ArcKioskAppService::PreconditionsChanged() {
<< (pending_policy_app_installs_.count(app_info_->package_name) << (pending_policy_app_installs_.count(app_info_->package_name)
? "non-compliant" ? "non-compliant"
: "compliant"); : "compliant");
RequestNameAndIconUpdate();
if (app_info_ && app_info_->ready && !maintenance_session_running_ && if (app_info_ && app_info_->ready && !maintenance_session_running_ &&
compliance_report_received_ && compliance_report_received_ &&
pending_policy_app_installs_.count(app_info_->package_name) == 0) { pending_policy_app_installs_.count(app_info_->package_name) == 0) {
...@@ -229,7 +232,6 @@ void ArcKioskAppService::PreconditionsChanged() { ...@@ -229,7 +232,6 @@ void ArcKioskAppService::PreconditionsChanged() {
VLOG(2) << "Kiosk app should be closed"; VLOG(2) << "Kiosk app should be closed";
arc::CloseTask(task_id_); arc::CloseTask(task_id_);
} }
RequestNameAndIconUpdate();
} }
std::string ArcKioskAppService::GetAppId() { std::string ArcKioskAppService::GetAppId() {
......
...@@ -45,6 +45,7 @@ class ArcKioskAppService : public KeyedService, ...@@ -45,6 +45,7 @@ class ArcKioskAppService : public KeyedService,
class Delegate { class Delegate {
public: public:
Delegate() = default; Delegate() = default;
virtual void OnAppDataUpdated() = 0;
virtual void OnAppStarted() = 0; virtual void OnAppStarted() = 0;
virtual void OnAppWindowLaunched() = 0; virtual void OnAppWindowLaunched() = 0;
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include "chrome/browser/chromeos/login/wizard_controller.h" #include "chrome/browser/chromeos/login/wizard_controller.h"
#include "chrome/browser/lifetime/application_lifetime.h" #include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/chromeos/login/arc_kiosk_splash_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
#include "chromeos/login/auth/user_context.h" #include "chromeos/login/auth/user_context.h"
...@@ -34,7 +33,7 @@ constexpr base::TimeDelta kArcKioskSplashScreenMinTime = ...@@ -34,7 +33,7 @@ constexpr base::TimeDelta kArcKioskSplashScreenMinTime =
ArcKioskController::ArcKioskController(LoginDisplayHost* host, OobeUI* oobe_ui) ArcKioskController::ArcKioskController(LoginDisplayHost* host, OobeUI* oobe_ui)
: host_(host), : host_(host),
arc_kiosk_splash_screen_view_( arc_kiosk_splash_screen_view_(
oobe_ui->GetView<ArcKioskSplashScreenHandler>()) {} oobe_ui->GetView<AppLaunchSplashScreenHandler>()) {}
ArcKioskController::~ArcKioskController() { ArcKioskController::~ArcKioskController() {
if (arc_kiosk_splash_screen_view_) if (arc_kiosk_splash_screen_view_)
...@@ -44,6 +43,8 @@ ArcKioskController::~ArcKioskController() { ...@@ -44,6 +43,8 @@ ArcKioskController::~ArcKioskController() {
void ArcKioskController::StartArcKiosk(const AccountId& account_id) { void ArcKioskController::StartArcKiosk(const AccountId& account_id) {
DVLOG(1) << "Starting ARC Kiosk for account: " << account_id.GetUserEmail(); DVLOG(1) << "Starting ARC Kiosk for account: " << account_id.GetUserEmail();
account_id_ = account_id;
host_->GetLoginDisplay()->SetUIEnabled(true); host_->GetLoginDisplay()->SetUIEnabled(true);
arc_kiosk_splash_screen_view_->SetDelegate(this); arc_kiosk_splash_screen_view_->SetDelegate(this);
...@@ -56,7 +57,7 @@ void ArcKioskController::StartArcKiosk(const AccountId& account_id) { ...@@ -56,7 +57,7 @@ void ArcKioskController::StartArcKiosk(const AccountId& account_id) {
login_performer_->LoginAsArcKioskAccount(account_id); login_performer_->LoginAsArcKioskAccount(account_id);
} }
void ArcKioskController::OnCancelArcKioskLaunch() { void ArcKioskController::OnCancelAppLaunch() {
if (ArcKioskAppManager::Get()->GetDisableBailoutShortcut()) if (ArcKioskAppManager::Get()->GetDisableBailoutShortcut())
return; return;
...@@ -148,17 +149,27 @@ void ArcKioskController::OnProfilePrepared(Profile* profile, ...@@ -148,17 +149,27 @@ void ArcKioskController::OnProfilePrepared(Profile* profile,
ChromeKeyboardControllerClient::Get()->RebuildKeyboardIfEnabled(); ChromeKeyboardControllerClient::Get()->RebuildKeyboardIfEnabled();
if (arc_kiosk_splash_screen_view_) { if (arc_kiosk_splash_screen_view_) {
arc_kiosk_splash_screen_view_->UpdateArcKioskState( // In ARC kiosk mode, installing means waiting for app be registered.
ArcKioskSplashScreenView::ArcKioskState::WAITING_APP_LAUNCH); arc_kiosk_splash_screen_view_->UpdateAppLaunchState(
AppLaunchSplashScreenView::AppLaunchState::
APP_LAUNCH_STATE_INSTALLING_APPLICATION);
} }
} }
void ArcKioskController::OnAppDataUpdated() {
// Invokes Show() to update the app title and icon.
arc_kiosk_splash_screen_view_->Show();
}
void ArcKioskController::OnAppStarted() { void ArcKioskController::OnAppStarted() {
DVLOG(1) << "ARC Kiosk launch succeeded, wait for app window."; DVLOG(1) << "ARC Kiosk launch succeeded, wait for app window.";
if (arc_kiosk_splash_screen_view_) { if (arc_kiosk_splash_screen_view_) {
arc_kiosk_splash_screen_view_->UpdateArcKioskState( arc_kiosk_splash_screen_view_->UpdateAppLaunchState(
ArcKioskSplashScreenView::ArcKioskState::WAITING_APP_WINDOW); AppLaunchSplashScreenView::AppLaunchState::
APP_LAUNCH_STATE_WAITING_APP_WINDOW);
// Invokes Show() to update the app title and icon.
arc_kiosk_splash_screen_view_->Show();
} }
} }
...@@ -172,4 +183,13 @@ void ArcKioskController::OnAppWindowLaunched() { ...@@ -172,4 +183,13 @@ void ArcKioskController::OnAppWindowLaunched() {
CloseSplashScreen(); CloseSplashScreen();
} }
KioskAppManagerBase::App ArcKioskController::GetAppData() {
DCHECK(account_id_.is_valid());
const ArcKioskAppData* arc_app =
ArcKioskAppManager::Get()->GetAppByAccountId(account_id_);
DCHECK(arc_app);
KioskAppManagerBase::App app(*arc_app);
return app;
}
} // namespace chromeos } // namespace chromeos
...@@ -8,7 +8,9 @@ ...@@ -8,7 +8,9 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_service.h" #include "chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_service.h"
#include "chrome/browser/chromeos/app_mode/kiosk_app_manager_base.h"
#include "chrome/browser/chromeos/login/session/user_session_manager.h" #include "chrome/browser/chromeos/login/session/user_session_manager.h"
#include "chrome/browser/ui/webui/chromeos/login/app_launch_splash_screen_handler.h"
#include "chromeos/login/auth/login_performer.h" #include "chromeos/login/auth/login_performer.h"
class AccountId; class AccountId;
...@@ -20,7 +22,6 @@ class OneShotTimer; ...@@ -20,7 +22,6 @@ class OneShotTimer;
namespace chromeos { namespace chromeos {
class ArcKioskSplashScreenView;
class LoginDisplayHost; class LoginDisplayHost;
class OobeUI; class OobeUI;
class UserContext; class UserContext;
...@@ -30,7 +31,8 @@ class UserContext; ...@@ -30,7 +31,8 @@ class UserContext;
// updating the splash screen UI. // updating the splash screen UI.
class ArcKioskController : public LoginPerformer::Delegate, class ArcKioskController : public LoginPerformer::Delegate,
public UserSessionManagerDelegate, public UserSessionManagerDelegate,
public ArcKioskAppService::Delegate { public ArcKioskAppService::Delegate,
public AppLaunchSplashScreenView::Delegate {
public: public:
ArcKioskController(LoginDisplayHost* host, OobeUI* oobe_ui); ArcKioskController(LoginDisplayHost* host, OobeUI* oobe_ui);
...@@ -39,11 +41,6 @@ class ArcKioskController : public LoginPerformer::Delegate, ...@@ -39,11 +41,6 @@ class ArcKioskController : public LoginPerformer::Delegate,
// Starts ARC kiosk splash screen. // Starts ARC kiosk splash screen.
void StartArcKiosk(const AccountId& account_id); void StartArcKiosk(const AccountId& account_id);
// Invoked when the launch bailout shortcut key is pressed.
void OnCancelArcKioskLaunch();
// Invoked when the splash screen view gets being deleted.
void OnDeletingSplashScreenView();
private: private:
void CleanUp(); void CleanUp();
void CloseSplashScreen(); void CloseSplashScreen();
...@@ -61,13 +58,22 @@ class ArcKioskController : public LoginPerformer::Delegate, ...@@ -61,13 +58,22 @@ class ArcKioskController : public LoginPerformer::Delegate,
void OnProfilePrepared(Profile* profile, bool browser_launched) override; void OnProfilePrepared(Profile* profile, bool browser_launched) override;
// ArcKioskAppService::Delegate implementation: // ArcKioskAppService::Delegate implementation:
void OnAppDataUpdated() override;
void OnAppStarted() override; void OnAppStarted() override;
void OnAppWindowLaunched() override; void OnAppWindowLaunched() override;
// AppLaunchSplashScreenView::Delegate implementation:
KioskAppManagerBase::App GetAppData() override;
void OnCancelAppLaunch() override;
void OnDeletingSplashScreenView() override;
// Accound id of the app we are currently running.
AccountId account_id_;
// LoginDisplayHost owns itself. // LoginDisplayHost owns itself.
LoginDisplayHost* const host_; LoginDisplayHost* const host_;
// Owned by OobeUI. // Owned by OobeUI.
ArcKioskSplashScreenView* arc_kiosk_splash_screen_view_; AppLaunchSplashScreenView* arc_kiosk_splash_screen_view_;
// Not owning here. // Not owning here.
Profile* profile_ = nullptr; Profile* profile_ = nullptr;
......
...@@ -127,9 +127,6 @@ const char kUserAddingURL[] = "chrome://oobe/user-adding"; ...@@ -127,9 +127,6 @@ const char kUserAddingURL[] = "chrome://oobe/user-adding";
// URL which corresponds to the app launch splash WebUI. // URL which corresponds to the app launch splash WebUI.
const char kAppLaunchSplashURL[] = "chrome://oobe/app-launch-splash"; const char kAppLaunchSplashURL[] = "chrome://oobe/app-launch-splash";
// URL which corresponds to the ARC kiosk splash WebUI.
const char kArcKioskSplashURL[] = "chrome://oobe/arc-kiosk-splash";
// Duration of sign-in transition animation. // Duration of sign-in transition animation.
const int kLoginFadeoutTransitionDurationMs = 700; const int kLoginFadeoutTransitionDurationMs = 700;
...@@ -656,7 +653,7 @@ void LoginDisplayHostWebUI::OnStartAppLaunch() { ...@@ -656,7 +653,7 @@ void LoginDisplayHostWebUI::OnStartAppLaunch() {
void LoginDisplayHostWebUI::OnStartArcKiosk() { void LoginDisplayHostWebUI::OnStartArcKiosk() {
finalize_animation_type_ = ANIMATION_FADE_OUT; finalize_animation_type_ = ANIMATION_FADE_OUT;
if (!login_window_) { if (!login_window_) {
LoadURL(GURL(kArcKioskSplashURL)); LoadURL(GURL(kAppLaunchSplashURL));
} }
login_view_->set_should_emit_login_prompt_visible(false); login_view_->set_should_emit_login_prompt_visible(false);
......
...@@ -97,7 +97,6 @@ ...@@ -97,7 +97,6 @@
#include "chrome/browser/ui/ash/login_screen_client.h" #include "chrome/browser/ui/ash/login_screen_client.h"
#include "chrome/browser/ui/webui/chromeos/login/app_downloading_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/app_downloading_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/app_launch_splash_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/app_launch_splash_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/arc_kiosk_splash_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/arc_terms_of_service_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/arc_terms_of_service_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/assistant_optin_flow_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/assistant_optin_flow_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/auto_enrollment_check_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/auto_enrollment_check_screen_handler.h"
...@@ -197,7 +196,6 @@ const chromeos::StaticOobeScreenId kResumableScreens[] = { ...@@ -197,7 +196,6 @@ const chromeos::StaticOobeScreenId kResumableScreens[] = {
}; };
const chromeos::StaticOobeScreenId kScreensWithHiddenStatusArea[] = { const chromeos::StaticOobeScreenId kScreensWithHiddenStatusArea[] = {
chromeos::ArcKioskSplashScreenView::kScreenId,
chromeos::EnableAdbSideloadingScreenView::kScreenId, chromeos::EnableAdbSideloadingScreenView::kScreenId,
chromeos::EnableDebuggingScreenView::kScreenId, chromeos::EnableDebuggingScreenView::kScreenId,
chromeos::KioskAutolaunchScreenView::kScreenId, chromeos::KioskAutolaunchScreenView::kScreenId,
...@@ -718,10 +716,6 @@ void WizardController::ShowAutoEnrollmentCheckScreen() { ...@@ -718,10 +716,6 @@ void WizardController::ShowAutoEnrollmentCheckScreen() {
SetCurrentScreen(screen); SetCurrentScreen(screen);
} }
void WizardController::ShowArcKioskSplashScreen() {
SetCurrentScreen(GetScreen(ArcKioskSplashScreenView::kScreenId));
}
void WizardController::ShowHIDDetectionScreen() { void WizardController::ShowHIDDetectionScreen() {
SetCurrentScreen(GetScreen(HIDDetectionView::kScreenId)); SetCurrentScreen(GetScreen(HIDDetectionView::kScreenId));
} }
...@@ -1508,8 +1502,6 @@ void WizardController::AdvanceToScreen(OobeScreenId screen) { ...@@ -1508,8 +1502,6 @@ void WizardController::AdvanceToScreen(OobeScreenId screen) {
ShowAutoEnrollmentCheckScreen(); ShowAutoEnrollmentCheckScreen();
} else if (screen == AppLaunchSplashScreenView::kScreenId) { } else if (screen == AppLaunchSplashScreenView::kScreenId) {
AutoLaunchKioskApp(); AutoLaunchKioskApp();
} else if (screen == ArcKioskSplashScreenView::kScreenId) {
ShowArcKioskSplashScreen();
} else if (screen == HIDDetectionView::kScreenId) { } else if (screen == HIDDetectionView::kScreenId) {
ShowHIDDetectionScreen(); ShowHIDDetectionScreen();
} else if (screen == DeviceDisabledScreenView::kScreenId) { } else if (screen == DeviceDisabledScreenView::kScreenId) {
......
...@@ -185,7 +185,6 @@ class WizardController { ...@@ -185,7 +185,6 @@ class WizardController {
void ShowAppDownloadingScreen(); void ShowAppDownloadingScreen();
void ShowWrongHWIDScreen(); void ShowWrongHWIDScreen();
void ShowAutoEnrollmentCheckScreen(); void ShowAutoEnrollmentCheckScreen();
void ShowArcKioskSplashScreen();
void ShowHIDDetectionScreen(); void ShowHIDDetectionScreen();
void ShowDeviceDisabledScreen(); void ShowDeviceDisabledScreen();
void ShowEncryptionMigrationScreen(); void ShowEncryptionMigrationScreen();
......
...@@ -54,7 +54,6 @@ ...@@ -54,7 +54,6 @@
<link rel="stylesheet" href="oobe_screen_auto_enrollment_check.css"> <link rel="stylesheet" href="oobe_screen_auto_enrollment_check.css">
<link rel="stylesheet" href="oobe_screen_supervision_transition.css"> <link rel="stylesheet" href="oobe_screen_supervision_transition.css">
<link rel="stylesheet" href="screen_app_launch_splash.css"> <link rel="stylesheet" href="screen_app_launch_splash.css">
<link rel="stylesheet" href="screen_arc_kiosk_splash.css">
<link rel="stylesheet" href="screen_arc_terms_of_service.css"> <link rel="stylesheet" href="screen_arc_terms_of_service.css">
<link rel="stylesheet" href="screen_error_message.css"> <link rel="stylesheet" href="screen_error_message.css">
<link rel="stylesheet" href="screen_tpm_error.css"> <link rel="stylesheet" href="screen_tpm_error.css">
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
// <include src="oobe_select.js"> // <include src="oobe_select.js">
// <include src="screen_app_launch_splash.js"> // <include src="screen_app_launch_splash.js">
// <include src="screen_arc_kiosk_splash.js">
// <include src="screen_arc_terms_of_service.js"> // <include src="screen_arc_terms_of_service.js">
// <include src="screen_error_message.js"> // <include src="screen_error_message.js">
// <include src="screen_password_changed.js"> // <include src="screen_password_changed.js">
...@@ -81,7 +80,6 @@ cr.define('cr.ui.Oobe', function() { ...@@ -81,7 +80,6 @@ cr.define('cr.ui.Oobe', function() {
login.RecommendAppsScreen.register(); login.RecommendAppsScreen.register();
login.AppDownloadingScreen.register(); login.AppDownloadingScreen.register();
login.AppLaunchSplashScreen.register(); login.AppLaunchSplashScreen.register();
login.ArcKioskSplashScreen.register();
login.ConfirmPasswordScreen.register(); login.ConfirmPasswordScreen.register();
login.FatalErrorScreen.register(); login.FatalErrorScreen.register();
login.DeviceDisabledScreen.register(); login.DeviceDisabledScreen.register();
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
<include src="screen_tpm_error.html"> <include src="screen_tpm_error.html">
<include src="screen_wrong_hwid.html"> <include src="screen_wrong_hwid.html">
<include src="screen_app_launch_splash.html"> <include src="screen_app_launch_splash.html">
<include src="screen_arc_kiosk_splash.html">
<include src="screen_confirm_password.html"> <include src="screen_confirm_password.html">
<include src="screen_fatal_error.html"> <include src="screen_fatal_error.html">
<include src="screen_device_disabled.html"> <include src="screen_device_disabled.html">
......
...@@ -60,7 +60,6 @@ ...@@ -60,7 +60,6 @@
<link rel="stylesheet" href="oobe_screen_supervision_transition.css"> <link rel="stylesheet" href="oobe_screen_supervision_transition.css">
<link rel="stylesheet" href="screen_app_launch_splash.css"> <link rel="stylesheet" href="screen_app_launch_splash.css">
<link rel="stylesheet" href="screen_arc_kiosk_splash.css">
<link rel="stylesheet" href="screen_arc_terms_of_service.css"> <link rel="stylesheet" href="screen_arc_terms_of_service.css">
<link rel="stylesheet" href="screen_error_message.css"> <link rel="stylesheet" href="screen_error_message.css">
<link rel="stylesheet" href="screen_tpm_error.css"> <link rel="stylesheet" href="screen_tpm_error.css">
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
// <include src="oobe_select.js"> // <include src="oobe_select.js">
// <include src="screen_app_launch_splash.js"> // <include src="screen_app_launch_splash.js">
// <include src="screen_arc_kiosk_splash.js">
// <include src="screen_arc_terms_of_service.js"> // <include src="screen_arc_terms_of_service.js">
// <include src="screen_error_message.js"> // <include src="screen_error_message.js">
// <include src="screen_password_changed.js"> // <include src="screen_password_changed.js">
...@@ -88,7 +87,6 @@ cr.define('cr.ui.Oobe', function() { ...@@ -88,7 +87,6 @@ cr.define('cr.ui.Oobe', function() {
login.RecommendAppsScreen.register(); login.RecommendAppsScreen.register();
login.AppDownloadingScreen.register(); login.AppDownloadingScreen.register();
login.AppLaunchSplashScreen.register(); login.AppLaunchSplashScreen.register();
login.ArcKioskSplashScreen.register();
login.ConfirmPasswordScreen.register(); login.ConfirmPasswordScreen.register();
login.FatalErrorScreen.register(); login.FatalErrorScreen.register();
login.DeviceDisabledScreen.register(); login.DeviceDisabledScreen.register();
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
<include src="screen_tpm_error.html"> <include src="screen_tpm_error.html">
<include src="screen_wrong_hwid.html"> <include src="screen_wrong_hwid.html">
<include src="screen_app_launch_splash.html"> <include src="screen_app_launch_splash.html">
<include src="screen_arc_kiosk_splash.html">
<include src="screen_confirm_password.html"> <include src="screen_confirm_password.html">
<include src="screen_fatal_error.html"> <include src="screen_fatal_error.html">
<include src="screen_device_disabled.html"> <include src="screen_device_disabled.html">
......
/* Copyright 2017 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file. */
#arc-kiosk-splash {
-webkit-align-items: center;
-webkit-justify-content: center;
background: white;
display: flex;
min-height: 0;
}
#arc-splash-content {
-webkit-align-items: center;
-webkit-justify-content: center;
display: flex;
flex-direction: column;
min-height: 0;
position: relative;
}
#arc-splash-header {
background: left center no-repeat;
background-size: 96px;
color: #666;
display: flex;
font-size: 48px;
height: 96px;
line-height: 96px;
min-height: 0;
padding-inline-start: 108px;
}
#arc-splash-launch-text {
color: #666;
font-size: 18px;
padding-top: 50px;
}
#arc-splash-spinner {
height: 32px;
width: 32px;
}
#arc-splash-shortcut-info {
bottom: 50px;
color: gray;
left: 0;
position: absolute;
right: 0;
text-align: center;
}
<div id="arc-kiosk-splash" class="step hidden fullscreen" hidden>
<div id="arc-splash-content">
<div id="arc-splash-header" i18n-content="arcKioskProductName"></div>
<div id="arc-splash-launch-text" i18n-content="arcKioskStartMessage"></div>
<div id="arc-splash-spinner" class="spinner"></div>
</div>
<p id="arc-splash-shortcut-info" i18n-content="arcKioskShortcutInfo"></p>
</div>
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @fileoverview ARC Kiosk install/launch app splash screen implementation.
*/
login.createScreen('ArcKioskSplashScreen', 'arc-kiosk-splash', function() {
return {
EXTERNAL_API: [
'updateArcKioskMessage',
],
/** @override */
decorate() {},
/**
* Event handler that is invoked just before the frame is shown.
* @param {string} data Screen init payload.
*/
onBeforeShow(data) {
this.updateApp(data['appInfo']);
Oobe.getInstance().solidBackground = true;
},
/**
* Event handler that is invoked just before the frame is hidden.
*/
onBeforeHide() {
Oobe.getInstance().solidBackground = false;
},
/**
* Updates the app name and icon.
* @param {Object} app Details of app being launched.
*/
updateApp(app) {
$('arc-splash-header').textContent = app.name;
$('arc-splash-header').style.backgroundImage = 'url(' + app.iconURL + ')';
},
/**
* Updates the message for the current ARC kiosk state.
* @param {string} message Description for current state.
*/
updateArcKioskMessage(message) {
$('arc-splash-launch-text').textContent = message;
}
};
});
...@@ -1756,8 +1756,6 @@ jumbo_static_library("ui") { ...@@ -1756,8 +1756,6 @@ jumbo_static_library("ui") {
"webui/chromeos/login/app_downloading_screen_handler.h", "webui/chromeos/login/app_downloading_screen_handler.h",
"webui/chromeos/login/app_launch_splash_screen_handler.cc", "webui/chromeos/login/app_launch_splash_screen_handler.cc",
"webui/chromeos/login/app_launch_splash_screen_handler.h", "webui/chromeos/login/app_launch_splash_screen_handler.h",
"webui/chromeos/login/arc_kiosk_splash_screen_handler.cc",
"webui/chromeos/login/arc_kiosk_splash_screen_handler.h",
"webui/chromeos/login/arc_terms_of_service_screen_handler.cc", "webui/chromeos/login/arc_terms_of_service_screen_handler.cc",
"webui/chromeos/login/arc_terms_of_service_screen_handler.h", "webui/chromeos/login/arc_terms_of_service_screen_handler.h",
"webui/chromeos/login/assistant_optin_flow_screen_handler.cc", "webui/chromeos/login/assistant_optin_flow_screen_handler.cc",
......
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/webui/chromeos/login/arc_kiosk_splash_screen_handler.h"
#include <memory>
#include "base/values.h"
#include "chrome/browser/chromeos/login/arc_kiosk_controller.h"
#include "chrome/grit/chrome_unscaled_resources.h"
#include "chrome/grit/chromium_strings.h"
#include "chrome/grit/generated_resources.h"
#include "components/login/localized_values_builder.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/webui/web_ui_util.h"
#include "ui/gfx/image/image_skia.h"
namespace chromeos {
constexpr StaticOobeScreenId ArcKioskSplashScreenView::kScreenId;
ArcKioskSplashScreenHandler::ArcKioskSplashScreenHandler(
JSCallsContainer* js_calls_container)
: BaseScreenHandler(kScreenId, js_calls_container) {}
ArcKioskSplashScreenHandler::~ArcKioskSplashScreenHandler() {
if (controller_)
controller_->OnDeletingSplashScreenView();
}
void ArcKioskSplashScreenHandler::DeclareLocalizedValues(
::login::LocalizedValuesBuilder* builder) {
builder->Add("arcKioskStartMessage", IDS_APP_START_APP_WAIT_MESSAGE);
const base::string16 product_os_name =
l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_OS_NAME);
builder->Add("arcKioskShortcutInfo",
l10n_util::GetStringFUTF16(IDS_APP_START_BAILOUT_SHORTCUT_FORMAT,
product_os_name));
builder->Add("arcKioskProductName", product_os_name);
}
void ArcKioskSplashScreenHandler::Initialize() {
if (!show_on_init_)
return;
show_on_init_ = false;
Show();
}
void ArcKioskSplashScreenHandler::Show() {
if (!page_is_ready()) {
show_on_init_ = true;
return;
}
base::DictionaryValue data;
// |data| will take ownership of |app_info|.
std::unique_ptr<base::DictionaryValue> app_info =
std::make_unique<base::DictionaryValue>();
PopulateAppInfo(app_info.get());
data.Set("appInfo", std::move(app_info));
ShowScreenWithData(kScreenId, &data);
}
void ArcKioskSplashScreenHandler::RegisterMessages() {
AddCallback("cancelArcKioskLaunch",
&ArcKioskSplashScreenHandler::HandleCancelArcKioskLaunch);
}
void ArcKioskSplashScreenHandler::UpdateArcKioskState(ArcKioskState state) {
if (!page_is_ready())
return;
SetLaunchText(l10n_util::GetStringUTF8(GetProgressMessageFromState(state)));
}
void ArcKioskSplashScreenHandler::SetDelegate(ArcKioskController* controller) {
controller_ = controller;
}
void ArcKioskSplashScreenHandler::PopulateAppInfo(
base::DictionaryValue* out_info) {
out_info->SetString("name", l10n_util::GetStringUTF8(IDS_SHORT_PRODUCT_NAME));
out_info->SetString(
"iconURL",
webui::GetBitmapDataUrl(*ui::ResourceBundle::GetSharedInstance()
.GetImageSkiaNamed(IDR_PRODUCT_LOGO_128)
->bitmap()));
}
void ArcKioskSplashScreenHandler::SetLaunchText(const std::string& text) {
CallJS("login.ArcKioskSplashScreen.updateArcKioskMessage", text);
}
int ArcKioskSplashScreenHandler::GetProgressMessageFromState(
ArcKioskState state) {
switch (state) {
case ArcKioskState::STARTING_SESSION:
return IDS_SYNC_SETUP_SPINNER_TITLE;
case ArcKioskState::WAITING_APP_LAUNCH:
return IDS_APP_START_APP_WAIT_MESSAGE;
case ArcKioskState::WAITING_APP_WINDOW:
return IDS_APP_START_WAIT_FOR_APP_WINDOW_MESSAGE;
default:
NOTREACHED();
break;
}
return IDS_SYNC_SETUP_SPINNER_TITLE;
}
void ArcKioskSplashScreenHandler::HandleCancelArcKioskLaunch() {
if (!controller_) {
LOG(WARNING) << "No delegate set to handle cancel app launch";
return;
}
controller_->OnCancelArcKioskLaunch();
}
} // namespace chromeos
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ARC_KIOSK_SPLASH_SCREEN_HANDLER_H_
#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ARC_KIOSK_SPLASH_SCREEN_HANDLER_H_
#include <string>
#include "base/macros.h"
#include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h"
namespace base {
class DictionaryValue;
}
namespace chromeos {
class ArcKioskController;
// Interface for UI implementations of the ArcKioskSplashScreen.
class ArcKioskSplashScreenView {
public:
enum class ArcKioskState {
STARTING_SESSION,
WAITING_APP_LAUNCH,
WAITING_APP_WINDOW,
};
constexpr static StaticOobeScreenId kScreenId{"arc-kiosk-splash"};
ArcKioskSplashScreenView() = default;
virtual ~ArcKioskSplashScreenView() = default;
// Shows the contents of the screen.
virtual void Show() = 0;
// Set the current ARC kiosk state.
virtual void UpdateArcKioskState(ArcKioskState state) = 0;
// Sets screen this view belongs to.
virtual void SetDelegate(ArcKioskController* controller) = 0;
private:
DISALLOW_COPY_AND_ASSIGN(ArcKioskSplashScreenView);
};
// A class that handles the WebUI hooks for the ARC kiosk splash screen.
class ArcKioskSplashScreenHandler : public BaseScreenHandler,
public ArcKioskSplashScreenView {
public:
using TView = ArcKioskSplashScreenView;
explicit ArcKioskSplashScreenHandler(JSCallsContainer* js_calls_container);
~ArcKioskSplashScreenHandler() override;
private:
// BaseScreenHandler implementation:
void DeclareLocalizedValues(
::login::LocalizedValuesBuilder* builder) override;
void Initialize() override;
// WebUIMessageHandler implementation:
void RegisterMessages() override;
// ArcKioskSplashScreenView implementation:
void Show() override;
void UpdateArcKioskState(ArcKioskState state) override;
void SetDelegate(ArcKioskController* controller) override;
void PopulateAppInfo(base::DictionaryValue* out_info);
void SetLaunchText(const std::string& text);
int GetProgressMessageFromState(ArcKioskState state);
void HandleCancelArcKioskLaunch();
ArcKioskController* controller_ = nullptr;
bool show_on_init_ = false;
DISALLOW_COPY_AND_ASSIGN(ArcKioskSplashScreenHandler);
};
} // namespace chromeos
#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ARC_KIOSK_SPLASH_SCREEN_HANDLER_H_
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
#include "chrome/browser/ui/webui/chromeos/login/active_directory_password_change_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/active_directory_password_change_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/app_downloading_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/app_downloading_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/app_launch_splash_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/app_launch_splash_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/arc_kiosk_splash_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/arc_terms_of_service_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/arc_terms_of_service_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/assistant_optin_flow_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/assistant_optin_flow_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/auto_enrollment_check_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/auto_enrollment_check_screen_handler.h"
...@@ -114,7 +113,6 @@ namespace chromeos { ...@@ -114,7 +113,6 @@ namespace chromeos {
namespace { namespace {
const char* kKnownDisplayTypes[] = {OobeUI::kAppLaunchSplashDisplay, const char* kKnownDisplayTypes[] = {OobeUI::kAppLaunchSplashDisplay,
OobeUI::kArcKioskSplashDisplay,
OobeUI::kDiscoverDisplay, OobeUI::kDiscoverDisplay,
OobeUI::kGaiaSigninDisplay, OobeUI::kGaiaSigninDisplay,
OobeUI::kLoginDisplay, OobeUI::kLoginDisplay,
...@@ -326,7 +324,6 @@ void DisablePolymer2(content::URLDataSource* shared_source) { ...@@ -326,7 +324,6 @@ void DisablePolymer2(content::URLDataSource* shared_source) {
// static // static
const char OobeUI::kAppLaunchSplashDisplay[] = "app-launch-splash"; const char OobeUI::kAppLaunchSplashDisplay[] = "app-launch-splash";
const char OobeUI::kArcKioskSplashDisplay[] = "arc-kiosk-splash";
const char OobeUI::kDiscoverDisplay[] = "discover"; const char OobeUI::kDiscoverDisplay[] = "discover";
const char OobeUI::kGaiaSigninDisplay[] = "gaia-signin"; const char OobeUI::kGaiaSigninDisplay[] = "gaia-signin";
const char OobeUI::kLockDisplay[] = "lock"; const char OobeUI::kLockDisplay[] = "lock";
...@@ -446,9 +443,6 @@ void OobeUI::ConfigureOobeDisplay() { ...@@ -446,9 +443,6 @@ void OobeUI::ConfigureOobeDisplay() {
AddScreenHandler(std::make_unique<AppLaunchSplashScreenHandler>( AddScreenHandler(std::make_unique<AppLaunchSplashScreenHandler>(
js_calls_container_.get(), network_state_informer_, error_screen)); js_calls_container_.get(), network_state_informer_, error_screen));
AddScreenHandler(
std::make_unique<ArcKioskSplashScreenHandler>(js_calls_container_.get()));
AddScreenHandler( AddScreenHandler(
std::make_unique<DeviceDisabledScreenHandler>(js_calls_container_.get())); std::make_unique<DeviceDisabledScreenHandler>(js_calls_container_.get()));
......
...@@ -45,7 +45,6 @@ class OobeUI : public ui::MojoWebUIController { ...@@ -45,7 +45,6 @@ class OobeUI : public ui::MojoWebUIController {
// List of known types of OobeUI. Type added as path in chrome://oobe url, for // List of known types of OobeUI. Type added as path in chrome://oobe url, for
// example chrome://oobe/user-adding. // example chrome://oobe/user-adding.
static const char kAppLaunchSplashDisplay[]; static const char kAppLaunchSplashDisplay[];
static const char kArcKioskSplashDisplay[];
static const char kDiscoverDisplay[]; static const char kDiscoverDisplay[];
static const char kGaiaSigninDisplay[]; static const char kGaiaSigninDisplay[];
static const char kLockDisplay[]; static const char kLockDisplay[];
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
/** @const */ var SCREEN_TPM_ERROR = 'tpm-error-message'; /** @const */ var SCREEN_TPM_ERROR = 'tpm-error-message';
/** @const */ var SCREEN_PASSWORD_CHANGED = 'password-changed'; /** @const */ var SCREEN_PASSWORD_CHANGED = 'password-changed';
/** @const */ var SCREEN_APP_LAUNCH_SPLASH = 'app-launch-splash'; /** @const */ var SCREEN_APP_LAUNCH_SPLASH = 'app-launch-splash';
/** @const */ var SCREEN_ARC_KIOSK_SPLASH = 'arc-kiosk-splash';
/** @const */ var SCREEN_CONFIRM_PASSWORD = 'confirm-password'; /** @const */ var SCREEN_CONFIRM_PASSWORD = 'confirm-password';
/** @const */ var SCREEN_FATAL_ERROR = 'fatal-error'; /** @const */ var SCREEN_FATAL_ERROR = 'fatal-error';
/** @const */ var SCREEN_KIOSK_ENABLE = 'kiosk-enable'; /** @const */ var SCREEN_KIOSK_ENABLE = 'kiosk-enable';
...@@ -450,8 +449,6 @@ cr.define('cr.ui.login', function() { ...@@ -450,8 +449,6 @@ cr.define('cr.ui.login', function() {
} else if (name == ACCELERATOR_APP_LAUNCH_BAILOUT) { } else if (name == ACCELERATOR_APP_LAUNCH_BAILOUT) {
if (currentStepId == SCREEN_APP_LAUNCH_SPLASH) if (currentStepId == SCREEN_APP_LAUNCH_SPLASH)
chrome.send('cancelAppLaunch'); chrome.send('cancelAppLaunch');
if (currentStepId == SCREEN_ARC_KIOSK_SPLASH)
chrome.send('cancelArcKioskLaunch');
} else if (name == ACCELERATOR_APP_LAUNCH_NETWORK_CONFIG) { } else if (name == ACCELERATOR_APP_LAUNCH_NETWORK_CONFIG) {
if (currentStepId == SCREEN_APP_LAUNCH_SPLASH) if (currentStepId == SCREEN_APP_LAUNCH_SPLASH)
chrome.send('networkConfigRequest'); chrome.send('networkConfigRequest');
...@@ -689,8 +686,7 @@ cr.define('cr.ui.login', function() { ...@@ -689,8 +686,7 @@ cr.define('cr.ui.login', function() {
// screen. // screen.
// TODO: remove this special case when a better fix is found for the race // TODO: remove this special case when a better fix is found for the race
// condition. This if statement was introduced to fix http://b/113786350. // condition. This if statement was introduced to fix http://b/113786350.
if ((this.currentScreen.id == SCREEN_APP_LAUNCH_SPLASH || if (this.currentScreen.id == SCREEN_APP_LAUNCH_SPLASH &&
this.currentScreen.id == SCREEN_ARC_KIOSK_SPLASH) &&
screen.id == SCREEN_GAIA_SIGNIN) { screen.id == SCREEN_GAIA_SIGNIN) {
console.log( console.log(
this.currentScreen.id + this.currentScreen.id +
......
...@@ -73,7 +73,6 @@ var DISPLAY_TYPE = { ...@@ -73,7 +73,6 @@ var DISPLAY_TYPE = {
LOCK: 'lock', LOCK: 'lock',
USER_ADDING: 'user-adding', USER_ADDING: 'user-adding',
APP_LAUNCH_SPLASH: 'app-launch-splash', APP_LAUNCH_SPLASH: 'app-launch-splash',
ARC_KIOSK_SPLASH: 'arc-kiosk-splash',
DESKTOP_USER_MANAGER: 'login-add-user', DESKTOP_USER_MANAGER: 'login-add-user',
GAIA_SIGNIN: 'gaia-signin' GAIA_SIGNIN: 'gaia-signin'
}; };
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