Commit 6c52146d authored by Renato Silva's avatar Renato Silva Committed by Commit Bot

Adapt Chrome OS OOBE ARC Terms of Service to MD

Improves the overlay dialogs shown on OOBE ARC terms of service screen
to match MD specs.

Fixed: 1030466, 1032914
Change-Id: If10fcdec926d724f43c08034519dac5b14eb55c4
Bug: 1030466
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1953740Reviewed-by: default avatarYusuke Sato <yusukes@chromium.org>
Reviewed-by: default avatarDenis Kuznetsov [CET] <antrim@chromium.org>
Commit-Queue: Renato Silva <rrsilva@google.com>
Auto-Submit: Renato Silva <rrsilva@google.com>
Cr-Commit-Position: refs/heads/master@{#737239}
parent 6e96a1a1
...@@ -1808,6 +1808,11 @@ ...@@ -1808,6 +1808,11 @@
Learn more. Learn more.
</message> </message>
<!-- Common strings used in OOBE -->
<message name="IDS_CHROMEOS_OOBE_CLOSE_DIALOG" desc="Message to shown on a button for closing a modal dialog in OOBE">
Close
</message>
<!-- Auto launch managed guest sessions privacy notification --> <!-- Auto launch managed guest sessions privacy notification -->
<message name="IDS_AUTO_LAUNCH_NOTIFICATION_TITLE" desc="Title of the notification which is shown when the managed guest session auto launched."> <message name="IDS_AUTO_LAUNCH_NOTIFICATION_TITLE" desc="Title of the notification which is shown when the managed guest session auto launched.">
Managed guest session Managed guest session
...@@ -3000,6 +3005,9 @@ ...@@ -3000,6 +3005,9 @@
<message name="IDS_ARC_OPT_IN_LEARN_MORE_CLOSE" desc="Text for close button in learn more dialog"> <message name="IDS_ARC_OPT_IN_LEARN_MORE_CLOSE" desc="Text for close button in learn more dialog">
Close Close
</message> </message>
<message name="IDS_ARC_OPT_IN_LEARN_MORE_STATISTICS_TITLE" desc="Title for pop up overlay dialog when user clicks learn more UMA">
Usage and diagnostic data
</message>
<message name="IDS_ARC_OPT_IN_LEARN_MORE_STATISTICS" desc="Message shown in pop up overlay dialog when user clicks learn more UMA"> <message name="IDS_ARC_OPT_IN_LEARN_MORE_STATISTICS" desc="Message shown in pop up overlay dialog when user clicks learn more UMA">
<ph name="BEGIN_PARAGRAPH1">&lt;p&gt;</ph>This is general information about your device and how you use it (such as battery level, system and app activity, and errors). The data will be used to improve Android, and some aggregated information will also help Google apps and partners, such as Android developers, make their apps and products better.<ph name="END_PARAGRAPH1">&lt;/p&gt;</ph> <ph name="BEGIN_PARAGRAPH1">&lt;p&gt;</ph>This is general information about your device and how you use it (such as battery level, system and app activity, and errors). The data will be used to improve Android, and some aggregated information will also help Google apps and partners, such as Android developers, make their apps and products better.<ph name="END_PARAGRAPH1">&lt;/p&gt;</ph>
<ph name="BEGIN_PARAGRAPH2">&lt;p&gt;</ph>Turning off this feature doesn't affect your device's ability to send the information needed for essential services such as system updates and security.<ph name="END_PARAGRAPH2">&lt;/p&gt;</ph> <ph name="BEGIN_PARAGRAPH2">&lt;p&gt;</ph>Turning off this feature doesn't affect your device's ability to send the information needed for essential services such as system updates and security.<ph name="END_PARAGRAPH2">&lt;/p&gt;</ph>
...@@ -3012,6 +3020,9 @@ ...@@ -3012,6 +3020,9 @@
<ph name="BEGIN_PARAGRAPH3">&lt;p&gt;</ph>The owner can control this feature from Settings &gt; Advanced &gt; Automatically send diagnostic and usage data to Google.<ph name="END_PARAGRAPH3">&lt;/p&gt;</ph> <ph name="BEGIN_PARAGRAPH3">&lt;p&gt;</ph>The owner can control this feature from Settings &gt; Advanced &gt; Automatically send diagnostic and usage data to Google.<ph name="END_PARAGRAPH3">&lt;/p&gt;</ph>
<ph name="BEGIN_PARAGRAPH4">&lt;p&gt;</ph>If additional Web &amp; App Activity setting is turned on for your child, this data may be saved to their Google Account. Learn more about these settings and how to adjust them at families.google.com.<ph name="END_PARAGRAPH4">&lt;/p&gt;</ph> <ph name="BEGIN_PARAGRAPH4">&lt;p&gt;</ph>If additional Web &amp; App Activity setting is turned on for your child, this data may be saved to their Google Account. Learn more about these settings and how to adjust them at families.google.com.<ph name="END_PARAGRAPH4">&lt;/p&gt;</ph>
</message> </message>
<message name="IDS_ARC_OPT_IN_LEARN_MORE_BACKUP_AND_RESTORE_TITLE" desc="Title for pop up overlay dialog when user clicks learn more backup and restore">
Back up to Google Drive
</message>
<message name="IDS_ARC_OPT_IN_LEARN_MORE_BACKUP_AND_RESTORE" desc="Message shown in pop up overlay dialog when user clicks learn more backup and restore"> <message name="IDS_ARC_OPT_IN_LEARN_MORE_BACKUP_AND_RESTORE" desc="Message shown in pop up overlay dialog when user clicks learn more backup and restore">
<ph name="BEGIN_PARAGRAPH1">&lt;p&gt;</ph>Back up to Google Drive. Easily restore your data or switch device at any time. Your backup includes app data.<ph name="END_PARAGRAPH1">&lt;/p&gt;</ph> <ph name="BEGIN_PARAGRAPH1">&lt;p&gt;</ph>Back up to Google Drive. Easily restore your data or switch device at any time. Your backup includes app data.<ph name="END_PARAGRAPH1">&lt;/p&gt;</ph>
<ph name="BEGIN_PARAGRAPH2">&lt;p&gt;</ph>Your backups are uploaded to Google and encrypted using your Google Account password.<ph name="END_PARAGRAPH2">&lt;/p&gt;</ph> <ph name="BEGIN_PARAGRAPH2">&lt;p&gt;</ph>Your backups are uploaded to Google and encrypted using your Google Account password.<ph name="END_PARAGRAPH2">&lt;/p&gt;</ph>
...@@ -3024,6 +3035,9 @@ ...@@ -3024,6 +3035,9 @@
<ph name="BEGIN_PARAGRAPH2">&lt;p&gt;</ph>Backup data will not count toward your child's Drive storage quota.<ph name="END_PARAGRAPH2">&lt;/p&gt;</ph> <ph name="BEGIN_PARAGRAPH2">&lt;p&gt;</ph>Backup data will not count toward your child's Drive storage quota.<ph name="END_PARAGRAPH2">&lt;/p&gt;</ph>
<ph name="BEGIN_PARAGRAPH3">&lt;p&gt;</ph>You can turn this service off in Settings.<ph name="END_PARAGRAPH3">&lt;/p&gt;</ph> <ph name="BEGIN_PARAGRAPH3">&lt;p&gt;</ph>You can turn this service off in Settings.<ph name="END_PARAGRAPH3">&lt;/p&gt;</ph>
</message> </message>
<message name="IDS_ARC_OPT_IN_LEARN_MORE_LOCATION_SERVICES_TITLE" desc="Title for pop up overlay dialog when user clicks learn more location services">
Location Services
</message>
<message name="IDS_ARC_OPT_IN_LEARN_MORE_LOCATION_SERVICES" desc="Message shown in pop up overlay dialog when user clicks learn more location services"> <message name="IDS_ARC_OPT_IN_LEARN_MORE_LOCATION_SERVICES" desc="Message shown in pop up overlay dialog when user clicks learn more location services">
<ph name="BEGIN_PARAGRAPH1">&lt;p&gt;</ph>Google's location service uses sources like Wi-Fi, mobile networks, and sensors to help estimate your device’s location.<ph name="END_PARAGRAPH1">&lt;/p&gt;</ph> <ph name="BEGIN_PARAGRAPH1">&lt;p&gt;</ph>Google's location service uses sources like Wi-Fi, mobile networks, and sensors to help estimate your device’s location.<ph name="END_PARAGRAPH1">&lt;/p&gt;</ph>
<ph name="BEGIN_PARAGRAPH2">&lt;p&gt;</ph>You can turn off Location by turning off the main Location setting on your device. You can also turn off the use of Wi-Fi, mobile networks, and sensors for location in location settings.<ph name="END_PARAGRAPH2">&lt;/p&gt;</ph> <ph name="BEGIN_PARAGRAPH2">&lt;p&gt;</ph>You can turn off Location by turning off the main Location setting on your device. You can also turn off the use of Wi-Fi, mobile networks, and sensors for location in location settings.<ph name="END_PARAGRAPH2">&lt;/p&gt;</ph>
...@@ -3032,6 +3046,9 @@ ...@@ -3032,6 +3046,9 @@
<ph name="BEGIN_PARAGRAPH1">&lt;p&gt;</ph>Google's location service uses sources like Wi-Fi, mobile networks, and sensors to help estimate this device’s location.<ph name="END_PARAGRAPH1">&lt;/p&gt;</ph> <ph name="BEGIN_PARAGRAPH1">&lt;p&gt;</ph>Google's location service uses sources like Wi-Fi, mobile networks, and sensors to help estimate this device’s location.<ph name="END_PARAGRAPH1">&lt;/p&gt;</ph>
<ph name="BEGIN_PARAGRAPH2">&lt;p&gt;</ph>You can turn off Location by turning off the main Location setting on this device. You can also turn off the use of Wi-Fi, mobile networks, and sensors for location in location settings.<ph name="END_PARAGRAPH2">&lt;/p&gt;</ph> <ph name="BEGIN_PARAGRAPH2">&lt;p&gt;</ph>You can turn off Location by turning off the main Location setting on this device. You can also turn off the use of Wi-Fi, mobile networks, and sensors for location in location settings.<ph name="END_PARAGRAPH2">&lt;/p&gt;</ph>
</message> </message>
<message name="IDS_ARC_OPT_IN_LEARN_MORE_PAI_SERVICE_TITLE" desc="Title for pop up overlay dialog when user clicks learn more play auto install services">
Install Updates and Apps
</message>
<message name="IDS_ARC_OPT_IN_LEARN_MORE_PAI_SERVICE" desc="Message shown in pop up overlay dialog when user clicks learn more play auto install services."> <message name="IDS_ARC_OPT_IN_LEARN_MORE_PAI_SERVICE" desc="Message shown in pop up overlay dialog when user clicks learn more play auto install services.">
<ph name="BEGIN_PARAGRAPH1">&lt;p&gt;</ph>To remove apps, go to Settings &gt; Google Play Store &gt; Manage Android preferences &gt; Apps or Application manager. Then tap the app you want to uninstall (you may need to swipe right or left to find the app). Then tap Uninstall or Disable.<ph name="END_PARAGRAPH1">&lt;/p&gt;</ph> <ph name="BEGIN_PARAGRAPH1">&lt;p&gt;</ph>To remove apps, go to Settings &gt; Google Play Store &gt; Manage Android preferences &gt; Apps or Application manager. Then tap the app you want to uninstall (you may need to swipe right or left to find the app). Then tap Uninstall or Disable.<ph name="END_PARAGRAPH1">&lt;/p&gt;</ph>
</message> </message>
......
...@@ -535,21 +535,35 @@ bool ArcSupportHost::Initialize() { ...@@ -535,21 +535,35 @@ bool ArcSupportHost::Initialize() {
loadtime_data->SetString( loadtime_data->SetString(
"controlledByPolicy", "controlledByPolicy",
l10n_util::GetStringUTF16(IDS_CONTROLLED_SETTING_POLICY)); l10n_util::GetStringUTF16(IDS_CONTROLLED_SETTING_POLICY));
loadtime_data->SetString(
"learnMoreStatisticsTitle",
l10n_util::GetStringUTF16(IDS_ARC_OPT_IN_LEARN_MORE_STATISTICS_TITLE));
loadtime_data->SetString( loadtime_data->SetString(
"learnMoreStatistics", "learnMoreStatistics",
l10n_util::GetStringUTF16(is_child l10n_util::GetStringUTF16(is_child
? IDS_ARC_OPT_IN_LEARN_MORE_STATISTICS_CHILD ? IDS_ARC_OPT_IN_LEARN_MORE_STATISTICS_CHILD
: IDS_ARC_OPT_IN_LEARN_MORE_STATISTICS)); : IDS_ARC_OPT_IN_LEARN_MORE_STATISTICS));
loadtime_data->SetString(
"learnMoreBackupAndRestoreTitle",
l10n_util::GetStringUTF16(
IDS_ARC_OPT_IN_LEARN_MORE_BACKUP_AND_RESTORE_TITLE));
loadtime_data->SetString( loadtime_data->SetString(
"learnMoreBackupAndRestore", "learnMoreBackupAndRestore",
l10n_util::GetStringUTF16( l10n_util::GetStringUTF16(
is_child ? IDS_ARC_OPT_IN_LEARN_MORE_BACKUP_AND_RESTORE_CHILD is_child ? IDS_ARC_OPT_IN_LEARN_MORE_BACKUP_AND_RESTORE_CHILD
: IDS_ARC_OPT_IN_LEARN_MORE_BACKUP_AND_RESTORE)); : IDS_ARC_OPT_IN_LEARN_MORE_BACKUP_AND_RESTORE));
loadtime_data->SetString(
"learnMoreLocationServicesTitle",
l10n_util::GetStringUTF16(
IDS_ARC_OPT_IN_LEARN_MORE_LOCATION_SERVICES_TITLE));
loadtime_data->SetString( loadtime_data->SetString(
"learnMoreLocationServices", "learnMoreLocationServices",
l10n_util::GetStringUTF16( l10n_util::GetStringUTF16(
is_child ? IDS_ARC_OPT_IN_LEARN_MORE_LOCATION_SERVICES_CHILD is_child ? IDS_ARC_OPT_IN_LEARN_MORE_LOCATION_SERVICES_CHILD
: IDS_ARC_OPT_IN_LEARN_MORE_LOCATION_SERVICES)); : IDS_ARC_OPT_IN_LEARN_MORE_LOCATION_SERVICES));
loadtime_data->SetString(
"learnMorePaiServiceTitle",
l10n_util::GetStringUTF16(IDS_ARC_OPT_IN_LEARN_MORE_PAI_SERVICE_TITLE));
loadtime_data->SetString( loadtime_data->SetString(
"learnMorePaiService", "learnMorePaiService",
l10n_util::GetStringUTF16(IDS_ARC_OPT_IN_LEARN_MORE_PAI_SERVICE)); l10n_util::GetStringUTF16(IDS_ARC_OPT_IN_LEARN_MORE_PAI_SERVICE));
......
...@@ -389,7 +389,7 @@ IN_PROC_BROWSER_TEST_F(ArcTermsOfServiceScreenTest, LearnMoreDialogs) { ...@@ -389,7 +389,7 @@ IN_PROC_BROWSER_TEST_F(ArcTermsOfServiceScreenTest, LearnMoreDialogs) {
EXPECT_EQ( EXPECT_EQ(
GetEscapedMessageString(l10n_util::GetStringUTF8(content_resource_id)), GetEscapedMessageString(l10n_util::GetStringUTF8(content_resource_id)),
test::OobeJS().GetString("$('arc-learn-more-content').textContent")); test::OobeJS().GetString("$('arc-learn-more-content').textContent"));
test::OobeJS().TapOn("arc-tos-overlay-close-bottom"); test::OobeJS().ClickOnPath({"arc-tos-overlay-learn-more", "closeButton"});
} }
EXPECT_FALSE(screen_exit_result().has_value()); EXPECT_FALSE(screen_exit_result().has_value());
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
<include src="oobe_adb_sideloading_screen.html"> <include src="oobe_adb_sideloading_screen.html">
<include src="oobe_buttons.html"> <include src="oobe_buttons.html">
<include src="oobe_dialog.html"> <include src="oobe_dialog.html">
<include src="oobe_help_dialog.html">
<include src="oobe_network_icons.html"> <include src="oobe_network_icons.html">
<include src="oobe_enable_kiosk.html"> <include src="oobe_enable_kiosk.html">
<include src="oobe_reset.html"> <include src="oobe_reset.html">
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
// <include src="oobe_adb_sideloading_screen.js"> // <include src="oobe_adb_sideloading_screen.js">
// <include src="oobe_buttons.js"> // <include src="oobe_buttons.js">
// <include src="oobe_dialog.js"> // <include src="oobe_dialog.js">
// <include src="oobe_help_dialog.js">
// <include src="oobe_terms_of_service.js"> // <include src="oobe_terms_of_service.js">
// <include src="arc_terms_of_service.js"> // <include src="arc_terms_of_service.js">
// <include src="oobe_enable_kiosk.js"> // <include src="oobe_enable_kiosk.js">
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
<include src="oobe_adb_sideloading_screen.html"> <include src="oobe_adb_sideloading_screen.html">
<include src="oobe_buttons.html"> <include src="oobe_buttons.html">
<include src="oobe_dialog.html"> <include src="oobe_dialog.html">
<include src="oobe_help_dialog.html">
<include src="oobe_eula.html"> <include src="oobe_eula.html">
<include src="oobe_enable_kiosk.html"> <include src="oobe_enable_kiosk.html">
<include src="oobe_hid_detection.html"> <include src="oobe_hid_detection.html">
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
// <include src="oobe_adb_sideloading_screen.js"> // <include src="oobe_adb_sideloading_screen.js">
// <include src="oobe_buttons.js"> // <include src="oobe_buttons.js">
// <include src="oobe_dialog.js"> // <include src="oobe_dialog.js">
// <include src="oobe_help_dialog.js">
// <include src="oobe_eula.js"> // <include src="oobe_eula.js">
// <include src="oobe_enable_kiosk.js"> // <include src="oobe_enable_kiosk.js">
// <include src="oobe_terms_of_service.js"> // <include src="oobe_terms_of_service.js">
......
...@@ -8,10 +8,12 @@ ...@@ -8,10 +8,12 @@
--oobe-header-font-family: "Google Sans", Roboto, sans-serif; --oobe-header-font-family: "Google Sans", Roboto, sans-serif;
--oobe-header-font-size: 28px; --oobe-header-font-size: 28px;
--oobe-help-dialog-header-font-size: 15px;
--oobe-default-font-size: 13px; --oobe-default-font-size: 13px;
--oobe-default-font-weight: 400; /* regular */ --oobe-default-font-weight: 400; /* regular */
--oobe-header-font-weight: 400; /* regular */ --oobe-header-font-weight: 400; /* regular */
--oobe-help-dialog-header-font-weight: 500; /* medium */
--oobe-header-text-color: var(--google-grey-900); --oobe-header-text-color: var(--google-grey-900);
--oobe-subheader-text-color: var(--google-grey-700); --oobe-subheader-text-color: var(--google-grey-700);
...@@ -28,4 +30,12 @@ ...@@ -28,4 +30,12 @@
font-size: var(--oobe-header-font-size); font-size: var(--oobe-header-font-size);
font-weight: var(--oobe-default-font-weight); font-weight: var(--oobe-default-font-weight);
}; };
/* OOBE Help Dialog
*/
--oobe-help-dialog-header-font: {
font-family: var(--oobe-default-font-family);
font-size: var(--oobe-help-dialog-header-font-size);
font-weight: var(--oobe-help-dialog-header-font-weight);
};
} }
/* Copyright 2020 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. */
#help-dialog {
border: 0;
border-radius: 8px;
box-shadow: 0 1px 3px 0 rgba(var(--google-grey-800-rgb), 0.3),
0 4px 8px 3px rgba(var(--google-grey-800-rgb), 0.15);
flex: 1 1 auto;
max-width: 512px;
padding: 20px 20px 16px 20px;
width: 512px;
}
#help-dialog-title ::slotted(h1) {
color: var(--oobe-header-text-color);
@apply --oobe-help-dialog-header-font;
margin: 0;
padding-bottom: 8px;
user-select: none;
}
#content-container {
color: var(--oobe-text-color);
@apply --oobe-default-font;
padding-bottom: 20px;
}
#button-container {
display: flex;
justify-content: flex-end;
min-height: 0;
padding-top: 16px;
}
<!-- Copyright 2020 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. -->
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/color.html">
<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html">
<link rel="stylesheet" href="oobe_flex_layout.css">
<!--
OOBE Help Dialog
Implements the 'OOBE Help Dialog' according to MD specs.
The dialog provides two properties that can be set directly from HTML.
- titleKey - ID of the localized string to be used for the title.
- contentKey - ID of the localized string to be used for the content.
Alternatively, one can set their own title and content into the 'title'
and 'content' slots.
-->
<dom-module id="oobe-help-dialog">
<template>
<link rel="stylesheet" href="oobe_fonts.css">
<link rel="stylesheet" href="oobe_help_dialog.css">
<dialog id="help-dialog" part="dialog" aria-labelledby="help-dialog-title">
<!-- Title -->
<div id="help-dialog-title">
<slot name="title">
<h1>[[i18nDynamic(locale, titleKey)]]</h1>
</slot>
</div>
<!-- Content to be shown -->
<div id="content-container"
class="flex-grow layout vertical not-resizable">
<slot name="content">
<h1>[[i18nDynamic(locale, contentKey)]]</h1>
</slot>
</div>
<!-- Close Button -->
<div id="button-container" class="layout horizontal">
<oobe-text-button inverse id="closeButton" on-click="hideDialog"
text-key="oobeModalDialogClose">
</oobe-text-button>
</div>
</dialog>
</template>
</dom-module>
// Copyright 2020 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.
Polymer({
is: 'oobe-help-dialog',
behaviors: [OobeI18nBehavior],
properties: {
/* The ID of the localized string to be used as title text when no "title"
* slot elements are specified.
*/
titleKey: {
type: String,
},
/* The ID of the localized string to be used as the content when no
* "content" slot elements are specified.
*/
contentKey: {
type: String,
},
},
ready: function() {},
/* Shows the help dialog and changes the focus to the close button. */
showDialog: function() {
this.$['help-dialog'].showModal();
this.$.closeButton.focus();
},
hideDialog: function() {
this.$['help-dialog'].close();
},
});
...@@ -2,23 +2,8 @@ ...@@ -2,23 +2,8 @@
* Use of this source code is governed by a BSD-style license that can be * Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file. */ * found in the LICENSE file. */
#arc-tos .popup-overlay {
background: rgba(0, 0, 0, .5);
}
#arc-tos-overlay-content-text {
box-sizing: border-box;
margin: auto;
min-height: 200px;
padding: 24px 8px 8px 8px;
width: 100%;
}
#arc-tos-overlay-content-text p { #arc-tos-overlay-content-text p {
color: rgba(0, 0, 0, 0.54);
font-family: 'Roboto';
font-size: 10px;
font-weight: 400;
text-align: justify; text-align: justify;
} }
...@@ -42,55 +27,3 @@ ...@@ -42,55 +27,3 @@
width: 100%; width: 100%;
} }
.arc-tos-overlay-close-top {
background-image: url(chrome://theme/IDR_CLOSE_DIALOG);
background-position: center;
background-repeat: no-repeat;
height: 14px;
position: absolute;
right: 7px;
top: 7px;
width: 14px;
z-index: 1;
}
html[dir='rtl'] .arc-tos-overlay-close-top {
left: 10px;
right: auto;
}
.arc-tos-button-strip {
display: flex;
justify-content: flex-end;
margin: 8px;
min-height: 0;
}
.arc-tos-overlay-close-top:hover {
background-image: url(chrome://theme/IDR_CLOSE_DIALOG_H);
}
.arc-tos-overlay-close-top:active {
background-image: url(chrome://theme/IDR_CLOSE_DIALOG_P);
}
.arc-overlay-url .oobe-popup {
max-width: 640px;
}
.arc-overlay-text #arc-tos-overlay-webview-container,
.arc-overlay-url #arc-tos-overlay-content-text {
display: none;
}
#arc-tos #arc-tos-overlay-content-text p {
color: rgba(0, 0, 0, 0.87);
font-size: 13px;
}
a.invisible-link {
display: inline-block;
height: 0;
width: 0;
}
...@@ -6,29 +6,16 @@ ...@@ -6,29 +6,16 @@
role="group" hidden> role="group" hidden>
<arc-tos-root id="arc-tos-root"></arc-tos-root> <arc-tos-root id="arc-tos-root"></arc-tos-root>
<div id="arc-tos-overlay" class="popup-overlay" <oobe-help-dialog id="arc-tos-overlay-privacy-policy">
role="dialog" aria-modal="true" hidden> <div slot="content" id="arc-tos-overlay-webview-container" >
<a href="#" id="arc-tos-overlay-start" class="arc-tos-invisible-link"></a> <webview id="arc-tos-overlay-webview"></webview>
<div id="arc-tos-overlay-container" class="oobe-popup not-resizable flex <div class="flex layout center-justified vertical" style="height: 100%;">
layout vertical stretch" role="dialog" aria-modal="true"> <throbber-notice></throbber-notice>
<div id="arc-tos-overlay-close-top"
class="arc-tos-overlay-close-top arc-overlay-close-button self-end">
</div>
<div id="arc-tos-overlay-webview-container">
<webview id="arc-tos-overlay-webview"></webview>
<div class="arc-tos-overlay-webview-loading">
<p i18n-content="arcOverlayLoading"></p>
</div>
</div>
<div id="arc-tos-overlay-content-text">
<span id="arc-learn-more-content"></span>
</div>
<div class="arc-tos-button-strip">
<oobe-text-button inverse id="arc-tos-overlay-close-bottom"
text-key="arcOverlayClose" class="arc-overlay-close-button">
</oobe-text-button>
</div> </div>
</div> </div>
<a href="#" id="arc-tos-overlay-end" class="arc-tos-invisible-link"></a> </oobe-help-dialog>
</div>
<oobe-help-dialog id="arc-tos-overlay-learn-more">
<span slot="content" id="arc-learn-more-content"></span>
</oobe-help-dialog>
</div> </div>
...@@ -59,11 +59,6 @@ login.createScreen('ArcTermsOfServiceScreen', 'arc-tos', function() { ...@@ -59,11 +59,6 @@ login.createScreen('ArcTermsOfServiceScreen', 'arc-tos', function() {
this.pageReady_ = true; this.pageReady_ = true;
$('arc-tos-root').screen = this; $('arc-tos-root').screen = this;
var closeButtons = document.querySelectorAll('.arc-overlay-close-button');
for (var i = 0; i < closeButtons.length; i++) {
closeButtons[i].addEventListener('click', this.hideOverlay.bind(this));
}
var termsView = this.getElement_('arc-tos-view'); var termsView = this.getElement_('arc-tos-view');
var requestFilter = {urls: ['<all_urls>'], types: ['main_frame']}; var requestFilter = {urls: ['<all_urls>'], types: ['main_frame']};
...@@ -113,22 +108,10 @@ login.createScreen('ArcTermsOfServiceScreen', 'arc-tos', function() { ...@@ -113,22 +108,10 @@ login.createScreen('ArcTermsOfServiceScreen', 'arc-tos', function() {
run_at: 'document_end' run_at: 'document_end'
}]); }]);
var closeOverlayButton = $('arc-tos-overlay-close-bottom'); $('arc-tos-overlay-learn-more')
var overlayUrlContainer = $('arc-tos-overlay-webview-container'); .addEventListener('close', this.hideOverlay.bind(this));
$('arc-tos-overlay-start').onfocus = function() { $('arc-tos-overlay-privacy-policy')
closeOverlayButton.focus(); .addEventListener('close', this.hideOverlay.bind(this));
};
$('arc-tos-overlay-end').onfocus = function() {
var style = window.getComputedStyle(overlayUrlContainer);
if (style.display == 'none') {
closeOverlayButton.focus();
} else {
overlayUrl.focus();
}
};
$('arc-tos-overlay-close-top').title =
loadTimeData.getString('arcOverlayClose');
// Update the screen size after setup layout. // Update the screen size after setup layout.
if (Oobe.getInstance().currentScreen === this) if (Oobe.getInstance().currentScreen === this)
...@@ -151,11 +134,18 @@ login.createScreen('ArcTermsOfServiceScreen', 'arc-tos', function() { ...@@ -151,11 +134,18 @@ login.createScreen('ArcTermsOfServiceScreen', 'arc-tos', function() {
} }
var self = this; var self = this;
var leanMoreStatisticsTitle =
loadTimeData.getString('arcLearnMoreStatisticsTitle');
var leanMoreStatisticsText = var leanMoreStatisticsText =
loadTimeData.getString('arcLearnMoreStatistics'); loadTimeData.getString('arcLearnMoreStatistics');
metrics.querySelector('#learn-more-link-metrics').onclick = function() {
self.showLearnMoreOverlay(leanMoreStatisticsText); var anchor = metrics.querySelector('#learn-more-link-metrics');
}; if (anchor) {
anchor.onclick = function() {
self.showLearnMoreOverlay(
leanMoreStatisticsText, leanMoreStatisticsTitle);
};
}
}, },
/** /**
...@@ -348,30 +338,20 @@ login.createScreen('ArcTermsOfServiceScreen', 'arc-tos', function() { ...@@ -348,30 +338,20 @@ login.createScreen('ArcTermsOfServiceScreen', 'arc-tos', function() {
}, },
/** /**
* Shows overlay dialog. * Shows an OOBE Help Dialog with the given title and content
* @param {string} defines overlay type, text or url. * @param {string} content HTML formatted text to show.
* @param {string} title Title for the dialog.
*/ */
showOverlay(overlayType) { showLearnMoreOverlay(content, title) {
$('arc-tos-overlay-learn-more').titleKey = title;
$('arc-learn-more-content').innerHTML = content;
this.lastFocusedElement = document.activeElement; this.lastFocusedElement = document.activeElement;
if (this.lastFocusedElement == $('arc-tos-root')) { if (this.lastFocusedElement == $('arc-tos-root')) {
this.lastFocusedElement = this.lastFocusedElement.getActiveElement(); this.lastFocusedElement = this.lastFocusedElement.getActiveElement();
} }
var overlayRoot = $('arc-tos-overlay'); $('arc-tos-overlay-learn-more').showDialog();
overlayRoot.classList.remove('arc-overlay-text');
overlayRoot.classList.remove('arc-overlay-url');
overlayRoot.classList.add(overlayType);
overlayRoot.hidden = false;
$('arc-tos-overlay-close-bottom').focus();
},
/**
* Sets learn more content text and shows it as overlay dialog.
* @param {string} content HTML formatted text to show.
*/
showLearnMoreOverlay(content) {
$('arc-learn-more-content').innerHTML = content;
this.showOverlay('arc-overlay-text');
}, },
/** /**
...@@ -387,15 +367,20 @@ login.createScreen('ArcTermsOfServiceScreen', 'arc-tos', function() { ...@@ -387,15 +367,20 @@ login.createScreen('ArcTermsOfServiceScreen', 'arc-tos', function() {
} else { } else {
webView.src = targetUrl; webView.src = targetUrl;
} }
this.lastFocusedElement = document.activeElement;
if (this.lastFocusedElement == $('arc-tos-root')) {
this.lastFocusedElement = this.lastFocusedElement.getActiveElement();
}
$('arc-tos-overlay-webview-container').classList.add('overlay-loading'); $('arc-tos-overlay-webview-container').classList.add('overlay-loading');
this.showOverlay('arc-overlay-url'); $('arc-tos-overlay-privacy-policy').showDialog();
}, },
/** /**
* Hides overlay dialog. * Hides overlay dialog.
*/ */
hideOverlay() { hideOverlay() {
$('arc-tos-overlay').hidden = true;
if (this.lastFocusedElement) { if (this.lastFocusedElement) {
this.lastFocusedElement.focus(); this.lastFocusedElement.focus();
this.lastFocusedElement = null; this.lastFocusedElement = null;
...@@ -571,7 +556,6 @@ login.createScreen('ArcTermsOfServiceScreen', 'arc-tos', function() { ...@@ -571,7 +556,6 @@ login.createScreen('ArcTermsOfServiceScreen', 'arc-tos', function() {
onBeforeShow(data) { onBeforeShow(data) {
this.setLearnMoreHandlers_(); this.setLearnMoreHandlers_();
this.hideOverlay();
this.focusButton_(); this.focusButton_();
$('arc-tos-root').onBeforeShow(); $('arc-tos-root').onBeforeShow();
...@@ -666,34 +650,40 @@ login.createScreen('ArcTermsOfServiceScreen', 'arc-tos', function() { ...@@ -666,34 +650,40 @@ login.createScreen('ArcTermsOfServiceScreen', 'arc-tos', function() {
setLearnMoreHandlers_() { setLearnMoreHandlers_() {
var self = this; var self = this;
var learnMoreBackupAndRestoreText = /* Checkboxes on the ARC TOS screen have a special link within their
loadTimeData.getString('arcLearnMoreBackupAndRestore'); description with a unique link_id that should open an overlay showing
var backupAndRestore = this.getElement_('arc-enable-backup-restore'); some content related to it.
backupAndRestore.parentElement */
.querySelector('#learn-more-link-backup-restore') function SetUpLearnMoreCheckBox(title, content, checkbox_id, link_id) {
.onclick = function(event) { var content = loadTimeData.getString(content);
event.stopPropagation(); var checkbox = self.getElement_(checkbox_id);
self.showLearnMoreOverlay(learnMoreBackupAndRestoreText);
}; var anchor = checkbox.parentElement.querySelector('#' + link_id);
if (anchor) {
var learnMoreLocationServiceText = anchor.onclick = function(event) {
loadTimeData.getString('arcLearnMoreLocationService'); event.stopPropagation();
var locationService = this.getElement_('arc-enable-location-service'); self.showLearnMoreOverlay(content, title);
locationService.parentElement };
.querySelector('#learn-more-link-location-service') }
.onclick = function(event) { }
event.stopPropagation();
self.showLearnMoreOverlay(learnMoreLocationServiceText);
};
var learnMorePaiServiceText = SetUpLearnMoreCheckBox(
loadTimeData.getString('arcLearnMorePaiService'); title = 'arcLearnMoreBackupAndRestoreTitle',
var paiService = this.getElement_('arc-pai-service'); content = 'arcLearnMoreBackupAndRestore',
paiService.querySelector('#learn-more-link-pai').onclick = function( checkbox_id = 'arc-enable-backup-restore',
event) { link_id = 'learn-more-link-backup-restore');
event.stopPropagation();
self.showLearnMoreOverlay(learnMorePaiServiceText); SetUpLearnMoreCheckBox(
}; title = 'arcLearnMoreLocationServiceTitle',
content = 'arcLearnMoreLocationService',
checkbox_id = 'arc-enable-location-service',
link_id = 'learn-more-link-location-service');
SetUpLearnMoreCheckBox(
title = 'arcLearnMorePaiServiceTitle',
content = 'arcLearnMorePaiService',
checkbox_id = 'arc-pai-service',
link_id = 'learn-more-link-pai');
}, },
/** /**
......
...@@ -138,19 +138,28 @@ void ArcTermsOfServiceScreenHandler::DeclareLocalizedValues( ...@@ -138,19 +138,28 @@ void ArcTermsOfServiceScreenHandler::DeclareLocalizedValues(
builder->Add("arcTextMetricsDemoApps", IDS_ARC_OOBE_TERMS_DIALOG_DEMO_APPS); builder->Add("arcTextMetricsDemoApps", IDS_ARC_OOBE_TERMS_DIALOG_DEMO_APPS);
builder->Add("arcAcceptAndContinueGoogleServiceConfirmation", builder->Add("arcAcceptAndContinueGoogleServiceConfirmation",
IDS_ARC_OPT_IN_ACCEPT_AND_CONTINUE_GOOGLE_SERVICE_CONFIRMATION); IDS_ARC_OPT_IN_ACCEPT_AND_CONTINUE_GOOGLE_SERVICE_CONFIRMATION);
builder->Add("arcLearnMoreStatisticsTitle",
IDS_ARC_OPT_IN_LEARN_MORE_STATISTICS_TITLE);
builder->Add("arcLearnMoreStatistics", builder->Add("arcLearnMoreStatistics",
is_child_account_ ? IDS_ARC_OPT_IN_LEARN_MORE_STATISTICS_CHILD is_child_account_ ? IDS_ARC_OPT_IN_LEARN_MORE_STATISTICS_CHILD
: IDS_ARC_OPT_IN_LEARN_MORE_STATISTICS); : IDS_ARC_OPT_IN_LEARN_MORE_STATISTICS);
builder->Add("arcLearnMoreLocationServiceTitle",
IDS_ARC_OPT_IN_LEARN_MORE_LOCATION_SERVICES_TITLE);
builder->Add("arcLearnMoreLocationService", builder->Add("arcLearnMoreLocationService",
is_child_account_ is_child_account_
? IDS_ARC_OPT_IN_LEARN_MORE_LOCATION_SERVICES_CHILD ? IDS_ARC_OPT_IN_LEARN_MORE_LOCATION_SERVICES_CHILD
: IDS_ARC_OPT_IN_LEARN_MORE_LOCATION_SERVICES); : IDS_ARC_OPT_IN_LEARN_MORE_LOCATION_SERVICES);
builder->Add("arcLearnMoreBackupAndRestoreTitle",
IDS_ARC_OPT_IN_LEARN_MORE_BACKUP_AND_RESTORE_TITLE);
builder->Add("arcLearnMoreBackupAndRestore", builder->Add("arcLearnMoreBackupAndRestore",
is_child_account_ is_child_account_
? IDS_ARC_OPT_IN_LEARN_MORE_BACKUP_AND_RESTORE_CHILD ? IDS_ARC_OPT_IN_LEARN_MORE_BACKUP_AND_RESTORE_CHILD
: IDS_ARC_OPT_IN_LEARN_MORE_BACKUP_AND_RESTORE); : IDS_ARC_OPT_IN_LEARN_MORE_BACKUP_AND_RESTORE);
builder->Add("arcLearnMorePaiServiceTitle",
IDS_ARC_OPT_IN_LEARN_MORE_PAI_SERVICE_TITLE);
builder->Add("arcLearnMorePaiService", IDS_ARC_OPT_IN_LEARN_MORE_PAI_SERVICE); builder->Add("arcLearnMorePaiService", IDS_ARC_OPT_IN_LEARN_MORE_PAI_SERVICE);
builder->Add("arcOverlayClose", IDS_ARC_OOBE_TERMS_POPUP_HELP_CLOSE_BUTTON); builder->Add("arcOverlayClose", IDS_ARC_OOBE_TERMS_POPUP_HELP_CLOSE_BUTTON);
builder->Add("oobeModalDialogClose", IDS_CHROMEOS_OOBE_CLOSE_DIALOG);
builder->Add("arcOverlayLoading", IDS_ARC_POPUP_HELP_LOADING); builder->Add("arcOverlayLoading", IDS_ARC_POPUP_HELP_LOADING);
} }
......
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