Commit 2e2c8963 authored by Anatoliy Potapchuk's avatar Anatoliy Potapchuk Committed by Commit Bot

[Kiosk] Expose app origin during launch for Web App kiosk

This CL updates the app launch screen, additionally surfacing app
origin. This help users be aware of the app that is being launched.

Bug: 1046260
Change-Id: Ibc525ddb50ba233dd6da1986a228e8b216719c5d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2127686
Commit-Queue: Anatoliy Potapchuk <apotapchuk@chromium.org>
Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#754945}
parent 86c1372c
...@@ -68,7 +68,10 @@ KioskAppManagerBase::App WebKioskController::GetAppData() { ...@@ -68,7 +68,10 @@ KioskAppManagerBase::App WebKioskController::GetAppData() {
const WebKioskAppData* app = const WebKioskAppData* app =
WebKioskAppManager::Get()->GetAppByAccountId(account_id_); WebKioskAppManager::Get()->GetAppByAccountId(account_id_);
DCHECK(app); DCHECK(app);
return KioskAppManagerBase::App(*app);
auto data = KioskAppManagerBase::App(*app);
data.url = app->install_url();
return data;
} }
void WebKioskController::OnTimerFire() { void WebKioskController::OnTimerFire() {
......
...@@ -18,16 +18,31 @@ ...@@ -18,16 +18,31 @@
position: relative; position: relative;
} }
#splash-header { #splash-title {
background: left center no-repeat; background: left center no-repeat;
background-size: 96px; background-size: 96px;
color: #666; display: flex;
font-size: 48px; flex-direction: column;
height: 96px; height: 96px;
line-height: 96px; justify-content: center;
max-width: 100%; max-width: 100%;
overflow: hidden;
padding-inline-start: 108px; padding-inline-start: 108px;
}
#splash-header {
color: #666;
font-size: 48px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;
}
#splash-subheader {
color: #666;
font-size: 18px;
font-style: italic;
overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
word-break: break-all; word-break: break-all;
......
<div id="app-launch-splash" class="step hidden fullscreen" hidden> <div id="app-launch-splash" class="step hidden fullscreen" hidden>
<div id="splash-content"> <div id="splash-content">
<div id="splash-header" i18n-content="productName"></div> <div id="splash-title">
<div id="splash-header" i18n-content="productName"></div>
<div id="splash-subheader"></div>
</div>
<div id="splash-launch-text" i18n-content="appStartMessage"></div> <div id="splash-launch-text" i18n-content="appStartMessage"></div>
<div id="splash-config-network-container" class="faded"> <div id="splash-config-network-container" class="faded">
<a id="splash-config-network" i18n-content="configureNetwork" href="javascript:void(0)"></a> <a id="splash-config-network" i18n-content="configureNetwork" href="javascript:void(0)"></a>
......
...@@ -92,7 +92,8 @@ login.createScreen('AppLaunchSplashScreen', 'app-launch-splash', function() { ...@@ -92,7 +92,8 @@ login.createScreen('AppLaunchSplashScreen', 'app-launch-splash', function() {
*/ */
updateApp(app) { updateApp(app) {
$('splash-header').textContent = app.name; $('splash-header').textContent = app.name;
$('splash-header').style.backgroundImage = 'url(' + app.iconURL + ')'; $('splash-subheader').textContent = app.url;
$('splash-title').style.backgroundImage = 'url(' + app.iconURL + ')';
}, },
/** /**
......
...@@ -65,14 +65,12 @@ void AppLaunchSplashScreenHandler::DeclareLocalizedValues( ...@@ -65,14 +65,12 @@ void AppLaunchSplashScreenHandler::DeclareLocalizedValues(
const base::string16 product_os_name = const base::string16 product_os_name =
l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_OS_NAME); l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_OS_NAME);
builder->Add( builder->Add("shortcutInfo",
"shortcutInfo", l10n_util::GetStringFUTF16(IDS_APP_START_BAILOUT_SHORTCUT_FORMAT,
l10n_util::GetStringFUTF16(IDS_APP_START_BAILOUT_SHORTCUT_FORMAT, product_os_name));
product_os_name));
builder->Add("productName",
builder->Add( l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_OS_NAME));
"productName",
l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_OS_NAME));
} }
void AppLaunchSplashScreenHandler::Initialize() { void AppLaunchSplashScreenHandler::Initialize() {
...@@ -111,8 +109,7 @@ void AppLaunchSplashScreenHandler::RegisterMessages() { ...@@ -111,8 +109,7 @@ void AppLaunchSplashScreenHandler::RegisterMessages() {
&AppLaunchSplashScreenHandler::HandleNetworkConfigRequested); &AppLaunchSplashScreenHandler::HandleNetworkConfigRequested);
} }
void AppLaunchSplashScreenHandler::Hide() { void AppLaunchSplashScreenHandler::Hide() {}
}
void AppLaunchSplashScreenHandler::ToggleNetworkConfig(bool visible) { void AppLaunchSplashScreenHandler::ToggleNetworkConfig(bool visible) {
CallJS("login.AppLaunchSplashScreen.toggleNetworkConfig", visible); CallJS("login.AppLaunchSplashScreen.toggleNetworkConfig", visible);
...@@ -230,8 +227,14 @@ void AppLaunchSplashScreenHandler::PopulateAppInfo( ...@@ -230,8 +227,14 @@ void AppLaunchSplashScreenHandler::PopulateAppInfo(
IDR_PRODUCT_LOGO_128); IDR_PRODUCT_LOGO_128);
} }
// Display app domain if present.
if (!app.url.is_empty()) {
app.url = app.url.GetOrigin();
}
out_info->SetString("name", app.name); out_info->SetString("name", app.name);
out_info->SetString("iconURL", webui::GetBitmapDataUrl(*app.icon.bitmap())); out_info->SetString("iconURL", webui::GetBitmapDataUrl(*app.icon.bitmap()));
out_info->SetString("url", app.url.spec());
} }
void AppLaunchSplashScreenHandler::SetLaunchText(const std::string& text) { void AppLaunchSplashScreenHandler::SetLaunchText(const std::string& text) {
......
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