Commit 3d9a40f2 authored by Maggie Cai's avatar Maggie Cai Committed by Chromium LUCI CQ

Revert "OOBE: Arc-ToS Improvements"

This reverts commit ddd08c52.

Reason for revert: This CL is likly the cause for test failure DemoSetupArcSupportedTest.OnlineSetupFlowErrorDefault in builder Linux Chromium OS ASan LSan Tests (1) starting from
https://ci.chromium.org/ui/p/chromium/builders/ci/Linux%20Chromium%20OS%20ASan%20LSan%20Tests%20(1)/39313/blamelist

Original change's description:
> OOBE: Arc-ToS Improvements
>
> Migrate ArcToSScreen to multistep behavior.
> Get rid of display: none; and display: block;
>
> Bug: 1156667
> Change-Id: I4c2fc425edd4883c5edfceb0a5a9f67a6227de7b
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2603744
> Commit-Queue: Ossama Mahmoud <osamafathy@google.com>
> Reviewed-by: Denis Kuznetsov [CET] <antrim@chromium.org>
> Reviewed-by: Roman Sorokin [CET] <rsorokin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#844554}

TBR=antrim@chromium.org,rsorokin@chromium.org,chromium-scoped@luci-project-accounts.iam.gserviceaccount.com,osamafathy@google.com

Change-Id: I62973f98fccb5086b852879395d04f4a3050c244
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1156667
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2636099Reviewed-by: default avatarMaggie Cai <mxcai@chromium.org>
Commit-Queue: Maggie Cai <mxcai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#844643}
parent 256dbee5
......@@ -41,7 +41,6 @@
#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
#include "chrome/common/pref_names.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/test/base/interactive_test_utils.h"
#include "chromeos/constants/chromeos_switches.h"
#include "chromeos/dbus/session_manager/fake_session_manager_client.h"
#include "components/arc/arc_prefs.h"
......@@ -98,12 +97,11 @@ const test::UIPath kArcReviewSettingsCheckbox = {kArcTosID,
"arcReviewSettingsCheckbox"};
const test::UIPath kArcTosAcceptButton = {kArcTosID, "arcTosAcceptButton"};
const test::UIPath kArcTosBackButton = {kArcTosID, "arcTosBackButton"};
const test::UIPath kArcTosDialog = {kArcTosID, "arcTosDialog"};
const test::UIPath kArcTosNextButton = {kArcTosID, "arcTosNextButton"};
const test::UIPath kArcTosOverlayWebview = {kArcTosID, "arcTosOverlayWebview"};
const test::UIPath kArcTosRetryButton = {kArcTosID, "arcTosRetryButton"};
const test::UIPath kArcTosView = {kArcTosID, "arcTosView"};
const test::UIPath kArcTosDialog = {kArcTosID, "arcTosDialog"};
const test::UIPath kArcTosErrorDialog = {kArcTosID, "arcTosErrorDialog"};
ArcPlayTermsOfServiceConsent BuildArcPlayTermsOfServiceConsent(bool accepted) {
ArcPlayTermsOfServiceConsent play_consent;
......@@ -263,7 +261,9 @@ class ArcTermsOfServiceScreenTest : public OobeBaseTest {
void WaitForTermsOfServiceWebViewToLoad() {
OobeScreenWaiter(ArcTermsOfServiceScreenView::kScreenId).Wait();
test::OobeJS().CreateVisibilityWaiter(true, kArcTosDialog)->Wait();
test::OobeJS()
.CreateHasClassWaiter(true, "arc-tos-loaded", kArcTosDialog)
->Wait();
}
void WaitForScreenExitResult() {
......@@ -533,41 +533,6 @@ IN_PROC_BROWSER_TEST_F(ArcTermsOfServiceScreenTest, RetryAndBackButtonClicked) {
1)));
}
IN_PROC_BROWSER_TEST_F(ArcTermsOfServiceScreenTest,
NextAndRetryButtonsFocused) {
TriggerArcTosScreen();
WaitForTermsOfServiceWebViewToLoad();
test::OobeJS().CreateFocusWaiter(kArcTosNextButton)->Wait();
// TODO(crbug/1167720): Make this a method of JSChecker
ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync(
nullptr, ui::VKEY_RETURN, false /* control */, false /* shift */,
false /* alt */, false /* command */));
test::OobeJS().CreateVisibilityWaiter(true, kArcTosAcceptButton)->Wait();
test::ExecuteOobeJS("$('arc-tos').onTermsViewErrorOccurred();");
test::OobeJS().CreateVisibilityWaiter(true, kArcTosErrorDialog)->Wait();
test::OobeJS().CreateFocusWaiter(kArcTosRetryButton)->Wait();
test::ExecuteOobeJS("$('arc-tos').reloadsLeftForTesting_ = 1");
ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync(
nullptr, ui::VKEY_RETURN, false /* control */, false /* shift */,
false /* alt */, false /* command */));
test::OobeJS().CreateVisibilityWaiter(true, kArcTosDialog)->Wait();
EXPECT_THAT(
histogram_tester_.GetAllSamples(
"OOBE.ArcTermsOfServiceScreen.UserActions"),
ElementsAre(
base::Bucket(
static_cast<int>(
ArcTermsOfServiceScreen::UserAction::kNextButtonClicked),
1),
base::Bucket(
static_cast<int>(
ArcTermsOfServiceScreen::UserAction::kRetryButtonClicked),
1)));
}
// There are two checkboxes for enabling/disabling arc backup restore and
// arc location service. This parameterized test executes all 4 combinations
// of enabled/disabled states and checks that advancing to the next screen by
......
......@@ -74,12 +74,6 @@ constexpr char kDefaultNetworkName[] = "eth1";
constexpr int kInvokeDemoModeGestureTapsCount = 10;
constexpr char kArcTosID[] = "arc-tos";
const test::UIPath kArcTosAcceptButton = {kArcTosID, "arcTosAcceptButton"};
const test::UIPath kArcTosBackButton = {kArcTosID, "arcTosBackButton"};
const test::UIPath kArcTosNextButton = {kArcTosID, "arcTosNextButton"};
// How js query is executed.
enum class JSExecution { kSync, kAsync };
......@@ -612,9 +606,10 @@ IN_PROC_BROWSER_TEST_F(DemoSetupArcSupportedTest,
ArcTermsOfServiceScreenView::kScreenId, DemoSetupDialog::kArcTos,
"#arcTosMetricsDemoApps"));
test::OobeJS().CreateVisibilityWaiter(true, kArcTosNextButton)->Wait();
test::OobeJS().ClickOnPath(kArcTosNextButton);
test::OobeJS().ClickOnPath(kArcTosAcceptButton);
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arcTosNextButton", JSExecution::kSync);
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arcTosAcceptButton", JSExecution::kAsync);
OobeScreenWaiter(DemoSetupScreenView::kScreenId).Wait();
EXPECT_TRUE(DemoSetupController::GetSubOrganizationEmail().empty());
......@@ -699,9 +694,10 @@ IN_PROC_BROWSER_TEST_F(DemoSetupArcSupportedTest,
EXPECT_TRUE(IsScreenShown(ArcTermsOfServiceScreenView::kScreenId));
SetPlayStoreTermsForTesting();
test::OobeJS().CreateVisibilityWaiter(true, kArcTosNextButton)->Wait();
test::OobeJS().ClickOnPath(kArcTosNextButton);
test::OobeJS().ClickOnPath(kArcTosAcceptButton);
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arcTosNextButton", JSExecution::kSync);
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arcTosAcceptButton", JSExecution::kAsync);
OobeScreenWaiter(DemoSetupScreenView::kScreenId).Wait();
// Verify the email corresponds to France.
......@@ -750,9 +746,10 @@ IN_PROC_BROWSER_TEST_F(DemoSetupArcSupportedTest, OnlineSetupFlowErrorDefault) {
EXPECT_TRUE(IsScreenShown(ArcTermsOfServiceScreenView::kScreenId));
SetPlayStoreTermsForTesting();
test::OobeJS().CreateVisibilityWaiter(true, kArcTosNextButton)->Wait();
test::OobeJS().ClickOnPath(kArcTosNextButton);
test::OobeJS().ClickOnPath(kArcTosAcceptButton);
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arcTosNextButton", JSExecution::kSync);
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arcTosAcceptButton", JSExecution::kAsync);
OobeScreenWaiter(DemoSetupScreenView::kScreenId).Wait();
// TODO(agawronska): Progress dialog transition is async - extra work is
......@@ -820,9 +817,10 @@ IN_PROC_BROWSER_TEST_F(DemoSetupArcSupportedTest,
EXPECT_TRUE(IsScreenShown(ArcTermsOfServiceScreenView::kScreenId));
SetPlayStoreTermsForTesting();
test::OobeJS().CreateVisibilityWaiter(true, kArcTosNextButton)->Wait();
test::OobeJS().ClickOnPath(kArcTosNextButton);
test::OobeJS().ClickOnPath(kArcTosAcceptButton);
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arcTosNextButton", JSExecution::kSync);
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arcTosAcceptButton", JSExecution::kAsync);
OobeScreenWaiter(DemoSetupScreenView::kScreenId).Wait();
// TODO(agawronska): Progress dialog transition is async - extra work is
......@@ -884,9 +882,10 @@ IN_PROC_BROWSER_TEST_F(DemoSetupArcSupportedTest,
EXPECT_TRUE(IsScreenShown(ArcTermsOfServiceScreenView::kScreenId));
SetPlayStoreTermsForTesting();
test::OobeJS().CreateVisibilityWaiter(true, kArcTosNextButton)->Wait();
test::OobeJS().ClickOnPath(kArcTosNextButton);
test::OobeJS().ClickOnPath(kArcTosAcceptButton);
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arcTosNextButton", JSExecution::kSync);
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arcTosAcceptButton", JSExecution::kAsync);
OobeScreenWaiter(DemoSetupScreenView::kScreenId).Wait();
// TODO(agawronska): Progress dialog transition is async - extra work is
......@@ -964,9 +963,10 @@ IN_PROC_BROWSER_TEST_F(DemoSetupArcSupportedTest, OfflineSetupFlowSuccess) {
ArcTermsOfServiceScreenView::kScreenId, DemoSetupDialog::kArcTos,
"#arcTosMetricsDemoApps"));
test::OobeJS().CreateVisibilityWaiter(true, kArcTosNextButton)->Wait();
test::OobeJS().ClickOnPath(kArcTosNextButton);
test::OobeJS().ClickOnPath(kArcTosAcceptButton);
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arcTosNextButton", JSExecution::kSync);
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arcTosAcceptButton", JSExecution::kAsync);
OobeScreenWaiter(DemoSetupScreenView::kScreenId).Wait();
// TODO(agawronska): Progress dialog transition is async - extra work is
......@@ -1024,9 +1024,10 @@ IN_PROC_BROWSER_TEST_F(DemoSetupArcSupportedTest,
EXPECT_TRUE(IsScreenShown(ArcTermsOfServiceScreenView::kScreenId));
SetPlayStoreTermsForTesting();
test::OobeJS().CreateVisibilityWaiter(true, kArcTosNextButton)->Wait();
test::OobeJS().ClickOnPath(kArcTosNextButton);
test::OobeJS().ClickOnPath(kArcTosAcceptButton);
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arcTosNextButton", JSExecution::kSync);
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arcTosAcceptButton", JSExecution::kAsync);
OobeScreenWaiter(DemoSetupScreenView::kScreenId).Wait();
// TODO(agawronska): Progress dialog transition is async - extra work is
......@@ -1089,9 +1090,10 @@ IN_PROC_BROWSER_TEST_F(DemoSetupArcSupportedTest,
EXPECT_TRUE(IsScreenShown(ArcTermsOfServiceScreenView::kScreenId));
SetPlayStoreTermsForTesting();
test::OobeJS().CreateVisibilityWaiter(true, kArcTosNextButton)->Wait();
test::OobeJS().ClickOnPath(kArcTosNextButton);
test::OobeJS().ClickOnPath(kArcTosAcceptButton);
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arcTosNextButton", JSExecution::kSync);
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arcTosAcceptButton", JSExecution::kAsync);
OobeScreenWaiter(DemoSetupScreenView::kScreenId).Wait();
// TODO(agawronska): Progress dialog transition is async - extra work is
......@@ -1183,8 +1185,8 @@ IN_PROC_BROWSER_TEST_F(DemoSetupArcSupportedTest, MAYBE_BackOnArcTermsScreen) {
SkipToScreen(ArcTermsOfServiceScreenView::kScreenId);
test::OobeJS().CreateVisibilityWaiter(true, kArcTosBackButton)->Wait();
test::OobeJS().ClickOnPath(kArcTosBackButton);
ClickOobeButton(ArcTermsOfServiceScreenView::kScreenId, OobeButton::kBack,
JSExecution::kSync);
OobeScreenWaiter(NetworkScreenView::kScreenId).Wait();
}
......
......@@ -80,8 +80,6 @@ using net::test_server::HttpResponse;
namespace chromeos {
namespace {
constexpr char kArcTosID[] = "arc-tos";
const test::UIPath kArcTosDialog = {kArcTosID, "arcTosDialog"};
enum class ArcState { kNotAvailable, kAcceptTerms };
std::string ArcStateToString(ArcState arc_state) {
......@@ -153,7 +151,10 @@ void WaitForGaiaSignInScreen(bool arc_available) {
// TODO(https://crbug/com/959902): Fix ARC terms of service screen to better
// handle this case.
if (arc_available) {
test::OobeJS().CreateVisibilityWaiter(true, kArcTosDialog)->Wait();
test::OobeJS()
.CreateHasClassWaiter(true, "arc-tos-loaded",
{"arc-tos", "arcTosDialog"})
->Wait();
}
LOG(INFO) << "OobeInteractiveUITest: Switched to 'gaia-signin' screen.";
......
......@@ -18,7 +18,27 @@ cr-checkbox {
--cr-checkbox-label-padding-start: 16px;
}
#errorMessage {
.arc-tos-loaded .arc-tos-loading,
.arc-tos-loaded .arc-tos-error,
.arc-tos-loaded #arcTosRetryButton,
.arc-tos-loading .arc-tos-content,
.arc-tos-loading .arc-tos-error,
.arc-tos-loading #arcTosRetryButton,
.arc-tos-loading #arcTosAcceptButton,
.error .arc-tos-content,
.error .arc-tos-loading,
.error #arcTosAcceptButton,
.error #arcTosNextButton {
display: none;
}
.arc-tos-loading #arcTosNextButton,
.arc-tos-loading #arcTosRetryButton {
pointer-events: none;
}
.arc-tos-loading p,
.error p {
color: rgba(0, 0, 0, 0.87);
font-size: 16px;
font-weight: 400;
......@@ -41,17 +61,33 @@ cr-checkbox {
font-weight: 600;
}
#arcTosContainer::-webkit-scrollbar {
display: none;
}
#arcTosView {
display: block;
height: 100%;
margin: auto;
min-height: 40px;
padding: 0;
width: 100%;
}
#arcTosViewContainer {
box-sizing: border-box;
margin: 0;
padding: 0;
}
#arcTosBackButton {
padding-inline-end: 6px;
}
#arcTosOverlayWebview {
border: 1px solid #d9d9d9;
display: flex;
display: block;
height: 300px;
width: 100%;
}
......
......@@ -19,69 +19,21 @@
<template>
<style include="oobe-dialog-host"></style>
<link rel="stylesheet" href="arc_terms_of_service.css">
<!-- LOADING DIALOG -->
<oobe-dialog id="arcTosLoadingDialog" has-buttons for-step="loading"
role="dialog"
aria-label$="[[i18nDynamic(locale, 'arcTermsOfServiceScreenHeading')]]">
<h1 slot="title">
[[i18nDynamic(locale, 'arcTermsOfServiceScreenHeading')]]
</h1>
<p slot="subtitle">
[[i18nDynamic(locale, 'arcTermsOfServiceScreenDescription')]]
</p>
<iron-icon src="chrome://oobe/playstore.svg" slot="oobe-icon">
</iron-icon>
<div slot="footer"
class="arc-tos-loading flex layout center-justified vertical">
<throbber-notice text-key="arcTermsOfServiceLoading">
</throbber-notice>
</div>
</oobe-dialog>
<!-- ERROR DIALOG -->
<oobe-dialog id="arcTosErrorDialog" has-buttons for-step="error"
role="dialog"
aria-label$="[[i18nDynamic(locale, 'arcTermsOfServiceScreenHeading')]]">
<h1 slot="title">
[[i18nDynamic(locale, 'arcTermsOfServiceScreenHeading')]]
</h1>
<p slot="subtitle">
[[i18nDynamic(locale, 'arcTermsOfServiceScreenDescription')]]
</p>
<iron-icon src="chrome://oobe/playstore.svg" slot="oobe-icon">
</iron-icon>
<div slot="footer">
<p id="errorMessage">
[[i18nDynamic(locale, 'arcTermsOfServiceError')]]
</p>
</div>
<div slot="bottom-buttons">
<oobe-text-button id="arcTosRetryButton" class="focus-on-show"
inverse on-click="onRetry_"
text-key="arcTermsOfServiceRetryButton"></oobe-text-button>
</div>
</oobe-dialog>
<!-- As this dialog have pre-loading logic that require access to elements,
dialog is marked as no-lazy. -->
<oobe-dialog id="arcTosDialog" has-buttons for-step="loaded"
<oobe-dialog id="arcTosDialog" has-buttons class="arc-tos-loading"
role="dialog"
aria-label$="[[i18nDynamic(locale, 'arcTermsOfServiceScreenHeading')]]"
no-lazy>
<h1 slot="title">
[[i18nDynamic(locale, 'arcTermsOfServiceScreenHeading')]]
</h1>
<p slot="subtitle">
[[i18nDynamic(locale, 'arcTermsOfServiceScreenDescription')]]
</p>
title-key="arcTermsOfServiceScreenHeading"
subtitle-key="arcTermsOfServiceScreenDescription" no-lazy>
<iron-icon src="chrome://oobe/playstore.svg" slot="oobe-icon">
</iron-icon>
<div id="arcTosContainer" slot="footer" class="flex layout vertical">
<div id="arcTosViewContainer" class="arc-tos-content flex">
<webview id="arcTosView" allowTransparency
role="document" class="flex oobe-tos-webview"
on-contentload="onTermsViewContentLoad_">
</webview>
class="oobe-tos-webview"
on-contentload="onTermsViewContentLoad_"></webview>
</div>
<div id="arcPolicyLink" class="arc-tos-content"
on-click="onPolicyLinkClick_">
<a class="oobe-local-link" is="action-link">
......@@ -161,13 +113,24 @@
</cr-checkbox>
</div>
</div>
<div class="arc-tos-loading flex layout center-justified vertical">
<throbber-notice text-key="arcTermsOfServiceLoading">
</throbber-notice>
</div>
<div class="arc-tos-error">
<p>[[i18nDynamic(locale, 'arcTermsOfServiceError')]]</p>
</div>
</div>
<div slot="back-navigation">
<oobe-back-button id="arcTosBackButton" hidden="[[!demoMode]]"
on-click="onBack_"></oobe-back-button>
</div>
<div slot="bottom-buttons">
<oobe-text-button id="arcTosNextButton" class="focus-on-show"
<oobe-text-button id="arcTosRetryButton"
inverse on-click="onRetry_"
disabled="[[arcTosButtonsDisabled]]"
text-key="arcTermsOfServiceRetryButton"></oobe-text-button>
<oobe-text-button id="arcTosNextButton"
inverse on-click="onNext_"
disabled="[[arcTosButtonsDisabled]]"
hidden="[[showFullDialog]]"
......@@ -224,8 +187,7 @@
<oobe-modal-dialog id="arcTosOverlayPrivacyPolicy"
on-close="onOverlayClosed_">
<div slot="content" id = "arcTosOverlayWebviewContainer">
<webview id="arcTosOverlayWebview"
hidden="[[overlayLoading_]]" class="flex oobe-tos-webview"
<webview id="arcTosOverlayWebview" hidden="[[overlayLoading_]]"
on-contentload="onAcrTosOverlayContentLoad_">
</webview>
<throbber-notice class="flex layout center-justified vertical"
......
......@@ -6,21 +6,11 @@
* @fileoverview Polymer element for displaying material design for ARC Terms Of
* Service screen.
*/
'use strict';
(function() {
// Enum that describes the current state of the Arc Terms Of Service screen
const UIState = {
LOADING: 'loading',
LOADED: 'loaded',
ERROR: 'error',
};
Polymer({
is: 'arc-tos-element',
behaviors: [OobeI18nBehavior, MultiStepBehavior, LoginScreenBehavior],
behaviors: [OobeI18nBehavior, OobeDialogHostBehavior, LoginScreenBehavior],
EXTERNAL_API: [
'setMetricsMode',
......@@ -190,13 +180,6 @@ Polymer({
*/
termsOfServiceHostName_: 'https://play.google.com',
defaultUIStep() {
return UIState.LOADING;
},
UI_STEPS: UIState,
/** @override */
ready() {
this.initializeLoginScreen('ArcTermsOfServiceScreen', {
......@@ -218,6 +201,7 @@ Polymer({
* Event handler that is invoked just before the screen is shown.
*/
onBeforeShow() {
this.focusButton_();
this.is_shown_ = true;
window.setTimeout(this.applyOobeConfiguration_.bind(this), 0);
......@@ -283,6 +267,20 @@ Polymer({
this.$.arcTosNextButton.focus();
},
focusButton_() {
var id;
if (this.hasClass_('arc-tos-loaded')) {
id = 'arcTosNextButton';
} else if (this.hasClass_('error')) {
id = 'arcTosRetryButton';
}
if (typeof id === 'undefined')
return;
Polymer.RenderStatus.afterNextRender(this, () => this.$[id].focus());
},
/**
* Makes sure that UI is initialized.
*
......@@ -412,7 +410,7 @@ Polymer({
countryCode = countryCode.toLowerCase();
if (this.language_ && this.language_ == language && this.countryCode_ &&
this.countryCode_ == countryCode && this.uiStep != UIState.ERROR &&
this.countryCode_ == countryCode && !this.classList.contains('error') &&
!this.usingOfflineTerms_ && this.tosContent_) {
this.enableButtons_(true);
return;
......@@ -438,7 +436,7 @@ Polymer({
// Try to use currently loaded document first.
var self = this;
if (termsView.src != '' && this.isLoaded_()) {
if (termsView.src != '' && this.classList.contains('arc-tos-loaded')) {
var navigateScript = 'processLangZoneTerms(true, \'' + language +
'\', \'' + countryCode + '\');';
termsView.executeScript({code: navigateScript}, function(results) {
......@@ -491,7 +489,7 @@ Polymer({
* @param {boolean} child whether current account is a child account.
*/
setArcManaged(managed, child) {
this.$.arcTosView.hidden = managed;
this.$.arcTosViewContainer.hidden = managed;
this.isChild = child;
},
......@@ -533,7 +531,9 @@ Polymer({
this.usingOfflineTerms_ = false;
var termsView = this.$.arcTosView;
termsView.src = this.termsOfServiceHostName_ + '/about/play-terms.html';
this.setUIStep(UIState.LOADING);
this.removeClass_('arc-tos-loaded');
this.removeClass_('error');
this.addClass_('arc-tos-loading');
this.enableButtons_(false);
},
......@@ -551,6 +551,36 @@ Polymer({
this.demoMode = false;
},
/**
* Adds new class to the list of classes of root OOBE style.
* @param {string} className class to remove.
*
* @private
*/
addClass_(className) {
this.$.arcTosDialog.classList.add(className);
},
/**
* Removes class from the list of classes of root OOBE style.
* @param {string} className class to remove.
*
* @private
*/
removeClass_(className) {
this.$.arcTosDialog.classList.remove(className);
},
/**
* Checks if class exists in the list of classes of root OOBE style.
* @param {string} className class to check.
*
* @private
*/
hasClass_(className) {
return this.$.arcTosDialog.classList.contains(className);
},
/**
* Returns a match pattern compatible version of termsOfServiceHostName_ by
* stripping the port number part of the hostname. During tests
......@@ -612,7 +642,10 @@ Polymer({
* @private
*/
setTermsViewContentLoadedState_() {
this.setUIStep(UIState.LOADED);
this.removeClass_('arc-tos-loading');
this.removeClass_('error');
this.addClass_('arc-tos-loaded');
this.enableButtons_(true);
this.showFullDialog = false;
this.$.arcTosNextButton.focus();
......@@ -640,7 +673,9 @@ Polymer({
*/
showError_() {
this.termsError = true;
this.setUIStep(UIState.ERROR);
this.removeClass_('arc-tos-loading');
this.removeClass_('arc-tos-loaded');
this.addClass_('error');
this.enableButtons_(true);
this.$.arcTosRetryButton.focus();
......@@ -671,7 +706,9 @@ Polymer({
* Shows loading screen for debugging purpose
*/
showLoadingScreenForTesting() {
this.setUIStep(UIState.LOADING);
this.removeClass_('arc-tos-loaded');
this.removeClass_('error');
this.addClass_('arc-tos-loading');
this.enableButtons_(false);
},
......@@ -777,6 +814,5 @@ Polymer({
this.lastFocusedElement_.focus();
this.lastFocusedElement_ = null;
}
},
}
});
})();
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