Commit 3ff1432b authored by Long Cheng's avatar Long Cheng Committed by Commit Bot

Migrate OOBE ARC dialog to Polymer 2

1. Move html out of string resources
2. polymer binding for UI properties most elements.
3. polymer binding for learn more callbacks
4. Move onNext/overlays to arc_terms_of_service for future
   reuse for in session opt-in extension.
5. Use multiple popup overlays with multiple <p> to support
   overlay text with multiple paragragh.
6. Remove skip button as it's no more supported for user.
   Add TODO for clean up.

Not all work is done with this cl. Things need follow up
1. Handle string loading before login.
2. Better handling webview.
3. Terms of service webview loading uses adding class to set
   display: none.
4. Large group of text are still not broken into blocks. 

Bug: 1047807
Test: Update browser tests
Test: Manual
Change-Id: If627f6680d416a134aa429359fb7352fe0cc5de3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2081252Reviewed-by: default avatarDenis Kuznetsov [CET] <antrim@chromium.org>
Commit-Queue: Long Cheng <lgcheng@google.com>
Cr-Commit-Position: refs/heads/master@{#748536}
parent f15f61d9
This diff is collapsed.
...@@ -102,7 +102,7 @@ std::string DialogToStringId(DemoSetupDialog dialog) { ...@@ -102,7 +102,7 @@ std::string DialogToStringId(DemoSetupDialog dialog) {
case DemoSetupDialog::kEula: case DemoSetupDialog::kEula:
return "eulaDialog"; return "eulaDialog";
case DemoSetupDialog::kArcTos: case DemoSetupDialog::kArcTos:
return "arc-tos-dialog"; return "arcTosDialog";
case DemoSetupDialog::kProgress: case DemoSetupDialog::kProgress:
return "demoSetupProgressDialog"; return "demoSetupProgressDialog";
case DemoSetupDialog::kError: case DemoSetupDialog::kError:
...@@ -565,12 +565,12 @@ IN_PROC_BROWSER_TEST_F(DemoSetupTest, OnlineSetupFlowSuccess) { ...@@ -565,12 +565,12 @@ IN_PROC_BROWSER_TEST_F(DemoSetupTest, OnlineSetupFlowSuccess) {
EXPECT_TRUE(IsScreenDialogElementVisible( EXPECT_TRUE(IsScreenDialogElementVisible(
ArcTermsOfServiceScreenView::kScreenId, DemoSetupDialog::kArcTos, ArcTermsOfServiceScreenView::kScreenId, DemoSetupDialog::kArcTos,
"#arc-tos-metrics-demo-apps")); "#arcTosMetricsDemoApps"));
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId, ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arc-tos-next-button", JSExecution::kSync); "#arcTosNextButton", JSExecution::kSync);
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId, ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arc-tos-accept-button", JSExecution::kAsync); "#arcTosAcceptButton", JSExecution::kAsync);
OobeScreenWaiter(UpdateView::kScreenId).Wait(); OobeScreenWaiter(UpdateView::kScreenId).Wait();
...@@ -658,9 +658,9 @@ IN_PROC_BROWSER_TEST_F(DemoSetupTest, ...@@ -658,9 +658,9 @@ IN_PROC_BROWSER_TEST_F(DemoSetupTest,
SetPlayStoreTermsForTesting(); SetPlayStoreTermsForTesting();
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId, ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arc-tos-next-button", JSExecution::kSync); "#arcTosNextButton", JSExecution::kSync);
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId, ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arc-tos-accept-button", JSExecution::kAsync); "#arcTosAcceptButton", JSExecution::kAsync);
OobeScreenWaiter(UpdateView::kScreenId).Wait(); OobeScreenWaiter(UpdateView::kScreenId).Wait();
...@@ -712,9 +712,9 @@ IN_PROC_BROWSER_TEST_F(DemoSetupTest, OnlineSetupFlowErrorDefault) { ...@@ -712,9 +712,9 @@ IN_PROC_BROWSER_TEST_F(DemoSetupTest, OnlineSetupFlowErrorDefault) {
SetPlayStoreTermsForTesting(); SetPlayStoreTermsForTesting();
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId, ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arc-tos-next-button", JSExecution::kSync); "#arcTosNextButton", JSExecution::kSync);
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId, ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arc-tos-accept-button", JSExecution::kAsync); "#arcTosAcceptButton", JSExecution::kAsync);
OobeScreenWaiter(UpdateView::kScreenId).Wait(); OobeScreenWaiter(UpdateView::kScreenId).Wait();
...@@ -776,9 +776,9 @@ IN_PROC_BROWSER_TEST_F(DemoSetupTest, OnlineSetupFlowErrorPowerwashRequired) { ...@@ -776,9 +776,9 @@ IN_PROC_BROWSER_TEST_F(DemoSetupTest, OnlineSetupFlowErrorPowerwashRequired) {
SetPlayStoreTermsForTesting(); SetPlayStoreTermsForTesting();
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId, ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arc-tos-next-button", JSExecution::kSync); "#arcTosNextButton", JSExecution::kSync);
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId, ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arc-tos-accept-button", JSExecution::kAsync); "#arcTosAcceptButton", JSExecution::kAsync);
OobeScreenWaiter(UpdateView::kScreenId).Wait(); OobeScreenWaiter(UpdateView::kScreenId).Wait();
...@@ -842,9 +842,9 @@ IN_PROC_BROWSER_TEST_F(DemoSetupTest, OnlineSetupFlowCrosComponentFailure) { ...@@ -842,9 +842,9 @@ IN_PROC_BROWSER_TEST_F(DemoSetupTest, OnlineSetupFlowCrosComponentFailure) {
SetPlayStoreTermsForTesting(); SetPlayStoreTermsForTesting();
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId, ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arc-tos-next-button", JSExecution::kSync); "#arcTosNextButton", JSExecution::kSync);
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId, ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arc-tos-accept-button", JSExecution::kAsync); "#arcTosAcceptButton", JSExecution::kAsync);
OobeScreenWaiter(UpdateView::kScreenId).Wait(); OobeScreenWaiter(UpdateView::kScreenId).Wait();
...@@ -922,12 +922,12 @@ IN_PROC_BROWSER_TEST_F(DemoSetupTest, OfflineSetupFlowSuccess) { ...@@ -922,12 +922,12 @@ IN_PROC_BROWSER_TEST_F(DemoSetupTest, OfflineSetupFlowSuccess) {
EXPECT_TRUE(IsScreenDialogElementVisible( EXPECT_TRUE(IsScreenDialogElementVisible(
ArcTermsOfServiceScreenView::kScreenId, DemoSetupDialog::kArcTos, ArcTermsOfServiceScreenView::kScreenId, DemoSetupDialog::kArcTos,
"#arc-tos-metrics-demo-apps")); "#arcTosMetricsDemoApps"));
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId, ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arc-tos-next-button", JSExecution::kSync); "#arcTosNextButton", JSExecution::kSync);
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId, ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arc-tos-accept-button", JSExecution::kAsync); "#arcTosAcceptButton", JSExecution::kAsync);
OobeScreenWaiter(DemoSetupScreenView::kScreenId).Wait(); OobeScreenWaiter(DemoSetupScreenView::kScreenId).Wait();
// TODO(agawronska): Progress dialog transition is async - extra work is // TODO(agawronska): Progress dialog transition is async - extra work is
...@@ -979,9 +979,9 @@ IN_PROC_BROWSER_TEST_F(DemoSetupTest, OfflineSetupFlowErrorDefault) { ...@@ -979,9 +979,9 @@ IN_PROC_BROWSER_TEST_F(DemoSetupTest, OfflineSetupFlowErrorDefault) {
SetPlayStoreTermsForTesting(); SetPlayStoreTermsForTesting();
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId, ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arc-tos-next-button", JSExecution::kSync); "#arcTosNextButton", JSExecution::kSync);
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId, ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arc-tos-accept-button", JSExecution::kAsync); "#arcTosAcceptButton", JSExecution::kAsync);
OobeScreenWaiter(DemoSetupScreenView::kScreenId).Wait(); OobeScreenWaiter(DemoSetupScreenView::kScreenId).Wait();
// TODO(agawronska): Progress dialog transition is async - extra work is // TODO(agawronska): Progress dialog transition is async - extra work is
...@@ -1044,9 +1044,9 @@ IN_PROC_BROWSER_TEST_F(DemoSetupTest, OfflineSetupFlowErrorPowerwashRequired) { ...@@ -1044,9 +1044,9 @@ IN_PROC_BROWSER_TEST_F(DemoSetupTest, OfflineSetupFlowErrorPowerwashRequired) {
SetPlayStoreTermsForTesting(); SetPlayStoreTermsForTesting();
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId, ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arc-tos-next-button", JSExecution::kSync); "#arcTosNextButton", JSExecution::kSync);
ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId, ClickOobeButtonWithSelector(ArcTermsOfServiceScreenView::kScreenId,
"#arc-tos-accept-button", JSExecution::kAsync); "#arcTosAcceptButton", JSExecution::kAsync);
OobeScreenWaiter(DemoSetupScreenView::kScreenId).Wait(); OobeScreenWaiter(DemoSetupScreenView::kScreenId).Wait();
// TODO(agawronska): Progress dialog transition is async - extra work is // TODO(agawronska): Progress dialog transition is async - extra work is
......
...@@ -77,7 +77,7 @@ using net::test_server::HttpResponse; ...@@ -77,7 +77,7 @@ using net::test_server::HttpResponse;
namespace chromeos { namespace chromeos {
namespace { namespace {
enum class ArcState { kNotAvailable, kAcceptTerms, kDeclineTerms }; enum class ArcState { kNotAvailable, kAcceptTerms };
std::string ArcStateToString(ArcState arc_state) { std::string ArcStateToString(ArcState arc_state) {
switch (arc_state) { switch (arc_state) {
...@@ -85,8 +85,6 @@ std::string ArcStateToString(ArcState arc_state) { ...@@ -85,8 +85,6 @@ std::string ArcStateToString(ArcState arc_state) {
return "not-available"; return "not-available";
case ArcState::kAcceptTerms: case ArcState::kAcceptTerms:
return "accept-terms"; return "accept-terms";
case ArcState::kDeclineTerms:
return "decline-terms";
} }
NOTREACHED(); NOTREACHED();
return "unknown"; return "unknown";
...@@ -150,7 +148,7 @@ void WaitForGaiaSignInScreen(bool arc_available) { ...@@ -150,7 +148,7 @@ void WaitForGaiaSignInScreen(bool arc_available) {
if (arc_available) { if (arc_available) {
test::OobeJS() test::OobeJS()
.CreateHasClassWaiter(true, "arc-tos-loaded", .CreateHasClassWaiter(true, "arc-tos-loaded",
{"arc-tos-root", "arc-tos-dialog"}) {"arc-tos-root", "arcTosDialog"})
->Wait(); ->Wait();
} }
...@@ -202,10 +200,9 @@ void RunDiscoverScreenChecks() { ...@@ -202,10 +200,9 @@ void RunDiscoverScreenChecks() {
EXPECT_FALSE(ash::LoginScreenTestApi::IsAddUserButtonShown()); EXPECT_FALSE(ash::LoginScreenTestApi::IsAddUserButtonShown());
} }
// Waits for the ARC terms of service screen to be shown, it accepts or // Waits for the ARC terms of service screen to be shown, it accepts
// declines the terms based in |accept_terms| value, and waits for the flow to // the terms, and waits for the flow to leave the ARC terms of service screen.
// leave the ARC terms of service screen. void HandleArcTermsOfServiceScreen() {
void HandleArcTermsOfServiceScreen(bool accept_terms) {
OobeScreenWaiter(ArcTermsOfServiceScreenView::kScreenId).Wait(); OobeScreenWaiter(ArcTermsOfServiceScreenView::kScreenId).Wait();
LOG(INFO) << "OobeInteractiveUITest: Switched to 'arc-tos' screen."; LOG(INFO) << "OobeInteractiveUITest: Switched to 'arc-tos' screen.";
...@@ -214,19 +211,17 @@ void HandleArcTermsOfServiceScreen(bool accept_terms) { ...@@ -214,19 +211,17 @@ void HandleArcTermsOfServiceScreen(bool accept_terms) {
EXPECT_FALSE(ash::LoginScreenTestApi::IsAddUserButtonShown()); EXPECT_FALSE(ash::LoginScreenTestApi::IsAddUserButtonShown());
test::OobeJS() test::OobeJS()
.CreateEnabledWaiter(true, {"arc-tos-root", "arc-tos-next-button"}) .CreateEnabledWaiter(true, {"arc-tos-root", "arcTosNextButton"})
->Wait(); ->Wait();
test::OobeJS().TapOnPath({"arc-tos-root", "arc-tos-next-button"}); test::OobeJS().TapOnPath({"arc-tos-root", "arcTosNextButton"});
test::OobeJS() test::OobeJS()
.CreateVisibilityWaiter(true, {"arc-tos-root", "arc-location-service"}) .CreateVisibilityWaiter(true, {"arc-tos-root", "arcLocationService"})
->Wait(); ->Wait();
test::OobeJS() test::OobeJS()
.CreateVisibilityWaiter(true, {"arc-tos-root", "arc-tos-accept-button"}) .CreateVisibilityWaiter(true, {"arc-tos-root", "arcTosAcceptButton"})
->Wait(); ->Wait();
const std::string button_to_click = test::OobeJS().TapOnPath({"arc-tos-root", "arcTosAcceptButton"});
accept_terms ? "arc-tos-accept-button" : "arc-tos-skip-button";
test::OobeJS().TapOnPath({"arc-tos-root", button_to_click});
OobeScreenExitWaiter(ArcTermsOfServiceScreenView::kScreenId).Wait(); OobeScreenExitWaiter(ArcTermsOfServiceScreenView::kScreenId).Wait();
LOG(INFO) << "OobeInteractiveUITest: 'arc-tos' screen done."; LOG(INFO) << "OobeInteractiveUITest: 'arc-tos' screen done.";
...@@ -736,8 +731,7 @@ void OobeInteractiveUITest::PerformSessionSignInSteps( ...@@ -736,8 +731,7 @@ void OobeInteractiveUITest::PerformSessionSignInSteps(
} }
if (test_setup()->arc_state() != ArcState::kNotAvailable) { if (test_setup()->arc_state() != ArcState::kNotAvailable) {
HandleArcTermsOfServiceScreen(test_setup()->arc_state() == HandleArcTermsOfServiceScreen();
ArcState::kAcceptTerms);
} }
if (test_setup()->arc_state() == ArcState::kAcceptTerms) { if (test_setup()->arc_state() == ArcState::kAcceptTerms) {
...@@ -787,8 +781,7 @@ INSTANTIATE_TEST_SUITE_P( ...@@ -787,8 +781,7 @@ INSTANTIATE_TEST_SUITE_P(
testing::Bool(), testing::Bool(),
testing::Bool(), testing::Bool(),
testing::Values(ArcState::kNotAvailable, testing::Values(ArcState::kNotAvailable,
ArcState::kAcceptTerms, ArcState::kAcceptTerms)));
ArcState::kDeclineTerms)));
class OobeZeroTouchInteractiveUITest : public OobeInteractiveUITest { class OobeZeroTouchInteractiveUITest : public OobeInteractiveUITest {
public: public:
...@@ -861,8 +854,7 @@ INSTANTIATE_TEST_SUITE_P( ...@@ -861,8 +854,7 @@ INSTANTIATE_TEST_SUITE_P(
testing::Bool(), testing::Bool(),
testing::Bool(), testing::Bool(),
testing::Values(ArcState::kNotAvailable, testing::Values(ArcState::kNotAvailable,
ArcState::kAcceptTerms, ArcState::kAcceptTerms)));
ArcState::kDeclineTerms)));
class PublicSessionOobeTest : public MixinBasedInProcessBrowserTest, class PublicSessionOobeTest : public MixinBasedInProcessBrowserTest,
public ::testing::WithParamInterface< public ::testing::WithParamInterface<
...@@ -954,8 +946,7 @@ INSTANTIATE_TEST_SUITE_P( ...@@ -954,8 +946,7 @@ INSTANTIATE_TEST_SUITE_P(
testing::Combine(testing::Bool(), testing::Combine(testing::Bool(),
testing::Bool(), testing::Bool(),
testing::Bool(), testing::Bool(),
testing::Values(ArcState::kNotAvailable, testing::Values(ArcState::kNotAvailable)));
ArcState::kDeclineTerms)));
class PublicSessionWithTermsOfServiceOobeTest : public PublicSessionOobeTest { class PublicSessionWithTermsOfServiceOobeTest : public PublicSessionOobeTest {
public: public:
...@@ -989,8 +980,7 @@ INSTANTIATE_TEST_SUITE_P( ...@@ -989,8 +980,7 @@ INSTANTIATE_TEST_SUITE_P(
testing::Combine(testing::Bool(), testing::Combine(testing::Bool(),
testing::Bool(), testing::Bool(),
testing::Bool(), testing::Bool(),
testing::Values(ArcState::kNotAvailable, testing::Values(ArcState::kNotAvailable)));
ArcState::kDeclineTerms)));
class EphemeralUserOobeTest : public MixinBasedInProcessBrowserTest, class EphemeralUserOobeTest : public MixinBasedInProcessBrowserTest,
public ::testing::WithParamInterface< public ::testing::WithParamInterface<
...@@ -1071,8 +1061,7 @@ IN_PROC_BROWSER_TEST_P(EphemeralUserOobeTest, DISABLED_RegularEphemeralUser) { ...@@ -1071,8 +1061,7 @@ IN_PROC_BROWSER_TEST_P(EphemeralUserOobeTest, DISABLED_RegularEphemeralUser) {
} }
if (test_setup()->arc_state() != ArcState::kNotAvailable) { if (test_setup()->arc_state() != ArcState::kNotAvailable) {
HandleArcTermsOfServiceScreen(test_setup()->arc_state() == HandleArcTermsOfServiceScreen();
ArcState::kAcceptTerms);
} }
if (test_setup()->arc_state() == ArcState::kAcceptTerms) { if (test_setup()->arc_state() == ArcState::kAcceptTerms) {
...@@ -1098,6 +1087,5 @@ INSTANTIATE_TEST_SUITE_P( ...@@ -1098,6 +1087,5 @@ INSTANTIATE_TEST_SUITE_P(
testing::Bool(), testing::Bool(),
testing::Bool(), testing::Bool(),
testing::Values(ArcState::kNotAvailable, testing::Values(ArcState::kNotAvailable,
ArcState::kAcceptTerms, ArcState::kAcceptTerms)));
ArcState::kDeclineTerms)));
} // namespace chromeos } // namespace chromeos
...@@ -130,10 +130,6 @@ js_library("arc_terms_of_service") { ...@@ -130,10 +130,6 @@ js_library("arc_terms_of_service") {
":html-echo", ":html-echo",
":oobe_dialog_host_behavior", ":oobe_dialog_host_behavior",
":oobe_i18n_behavior", ":oobe_i18n_behavior",
# This is a temporary change to proceed with Polymer v2 migration.
# TODO (https://crbug.com/1047807) : remove this dependecy.
"//ui/webui/resources/js:i18n_template",
] ]
} }
......
...@@ -14,37 +14,25 @@ p { ...@@ -14,37 +14,25 @@ p {
padding: 0; padding: 0;
} }
.arc-tos-disable-skip #arc-tos-skip-button,
.arc-tos-loaded .arc-tos-loading, .arc-tos-loaded .arc-tos-loading,
.arc-tos-loaded .arc-tos-error, .arc-tos-loaded .arc-tos-error,
.arc-tos-loaded #arc-tos-retry-button, .arc-tos-loaded #arcTosRetryButton,
.arc-tos-loading .arc-tos-content, .arc-tos-loading .arc-tos-content,
.arc-tos-loading .arc-tos-error, .arc-tos-loading .arc-tos-error,
.arc-tos-loading #arc-tos-retry-button, .arc-tos-loading #arcTosRetryButton,
.arc-tos-loading #arc-tos-accept-button, .arc-tos-loading #arcTosAcceptButton,
.error .arc-tos-content, .error .arc-tos-content,
.error .arc-tos-loading, .error .arc-tos-loading,
.error #arc-tos-accept-button, .error #arcTosAcceptButton,
.error #arc-tos-next-button { .error #arcTosNextButton {
display: none; display: none;
} }
.arc-tos-loading #arc-tos-next-button, .arc-tos-loading #arcTosNextButton,
.arc-tos-loading #arc-tos-skip-button, .arc-tos-loading #arcTosRetryButton {
.arc-tos-loading #arc-tos-retry-button {
pointer-events: none; pointer-events: none;
} }
.arc-tos-for-demo-mode #arc-location-service,
.arc-tos-for-demo-mode #arc-backup-service {
display: none;
}
#arc-tos-dialog:not(.arc-tos-for-demo-mode) #arc-tos-back-button,
#arc-tos-dialog:not(.arc-tos-for-demo-mode) #arc-tos-metrics-demo-apps {
display: none;
}
.arc-tos-loading p, .arc-tos-loading p,
.error p { .error p {
color: rgba(0, 0, 0, 0.87); color: rgba(0, 0, 0, 0.87);
...@@ -59,25 +47,22 @@ p { ...@@ -59,25 +47,22 @@ p {
padding: 0 20px 16px 20px; padding: 0 20px 16px 20px;
} }
#arc-policy-link { #arcPolicyLink {
margin: 0; margin: 0;
padding: 16px 0 16px 20px; padding: 16px 0 16px 20px;
} }
#arc-tos-skip-button {
color: rgba(0, 0, 0, 0.54);
}
#google-service-confirmation-text { #arcGoogleServiceConfirmation {
font-weight: 600; font-weight: 600;
} }
#arc-tos-container::-webkit-scrollbar { #arcTosContainer::-webkit-scrollbar {
display: none; display: none;
} }
#arc-tos-view { #arcTosView {
display: block; display: block;
height: 100%; height: 100%;
margin: auto; margin: auto;
...@@ -86,13 +71,27 @@ p { ...@@ -86,13 +71,27 @@ p {
width: 100%; width: 100%;
} }
#arc-tos-view-container { #arcTosViewContainer {
box-sizing: border-box; box-sizing: border-box;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
#arc-tos-back-button, #arcTosBackButton {
#arc-tos-skip-button {
padding-inline-end: 6px; padding-inline-end: 6px;
} }
#arcTosOverlayWebview {
border: 1px solid #d9d9d9;
display: block;
height: 300px;
width: 100%;
}
#arcTosOverlayWebviewContainer {
box-sizing: border-box;
height: 332px;
margin: auto;
padding: 24px 8px 8px 8px;
width: 100%;
}
...@@ -11,49 +11,88 @@ ...@@ -11,49 +11,88 @@
<link rel="stylesheet" href="oobe_dialog_host.css"> <link rel="stylesheet" href="oobe_dialog_host.css">
<link rel="stylesheet" href="arc_terms_of_service.css"> <link rel="stylesheet" href="arc_terms_of_service.css">
<link rel="stylesheet" href="oobe_flex_layout.css"> <link rel="stylesheet" href="oobe_flex_layout.css">
<oobe-dialog id="arc-tos-dialog" has-buttons class="arc-tos-loading" <oobe-dialog id="arcTosDialog" has-buttons class="arc-tos-loading"
title-key="arcTermsOfServiceScreenHeading" title-key="arcTermsOfServiceScreenHeading"
subtitle-key="arcTermsOfServiceScreenDescription"> subtitle-key="arcTermsOfServiceScreenDescription">
<iron-icon src="chrome://oobe/playstore.svg" slot="oobe-icon"> <iron-icon src="chrome://oobe/playstore.svg" slot="oobe-icon">
</iron-icon> </iron-icon>
<div id="arc-tos-container" slot="footer" class="flex layout vertical"> <div id="arcTosContainer" slot="footer" class="flex layout vertical">
<div id="arc-tos-view-container" class="arc-tos-content flex"> <div id="arcTosViewContainer" class="arc-tos-content flex">
<webview id="arc-tos-view" allowTransparency <webview id="arcTosView" allowTransparency
class="oobe-tos-webview"></webview> class="oobe-tos-webview"></webview>
</div> </div>
<div id="arc-policy-link" class="arc-tos-content"> <div id="arcPolicyLink" class="arc-tos-content">
<a href="#" i18n-content="arcPolicyLink"></a> <a href="#">[[i18nDynamic(locale, 'arcPolicyLink')]]</a>
</div> </div>
<div class="parameter-section arc-tos-content"> <div class="parameter-section arc-tos-content"
<p id="arc-text-metrics"></p> hidden="[[isMetricsHidden]]">
<p>
<span>[[i18nDynamic(locale, metricsTextKey)]]</span>
<a href="#" id="learnMoreLinkMetrics"
on-tap="onMetricsLearnMoreTap_">
[[i18nDynamic(locale, 'arcLearnMoreText')]]
</a>
</p>
</div> </div>
<div id="arc-tos-metrics-demo-apps" <div id="arcTosMetricsDemoApps"
class="parameter-section arc-tos-content"> class="parameter-section arc-tos-content"
hidden="[[!demoMode]]">
<p>[[i18nDynamic(locale, 'arcTextMetricsDemoApps')]]</p> <p>[[i18nDynamic(locale, 'arcTextMetricsDemoApps')]]</p>
</div> </div>
<div id="arc-backup-service" class="parameter-section arc-tos-content"> <div id="arcBackupService"
<cr-checkbox id="arc-enable-backup-restore"> class="parameter-section arc-tos-content"
<p i18n-values=".innerHTML:arcTextBackupRestore"></p> disabled="[[backupRestoreManaged]]"
hidden="[[demoMode]]">
<cr-checkbox id="arcEnableBackupRestore"
checked="{{backupRestore}}"
disabled="[[backupRestoreManaged]]">
<p>
<span>[[i18nDynamic(locale, 'arcTextBackupRestore')]]</span>
<a href="#" id="learnMoreLinkBackupRestore"
on-tap="onBackupRestoreLearnMoreTap_">
[[i18nDynamic(locale, 'arcLearnMoreText')]]
</a>
</p>
</cr-checkbox> </cr-checkbox>
</div> </div>
<div id="arc-location-service" <div id="arcExtraContent" hidden="[[!showFullDialog]]">
class="parameter-section arc-tos-content"> <div id="arcLocationService"
<cr-checkbox id="arc-enable-location-service"> class="parameter-section arc-tos-content"
<p i18n-values=".innerHTML:arcTextLocationService"></p> disabled="[[locationServiceManaged]]"
</cr-checkbox> hidden="[[demoMode]]">
</div> <cr-checkbox id="arcEnableLocationService"
<div id="arc-pai-service" class="parameter-section arc-tos-content"> checked="{{locationService}}"
<p i18n-values=".innerHTML:arcTextPaiService"></p> disabled="[[locationServiceManaged]]">
</div> <p>
<div id="arc-google-service-confirmation" <span>[[i18nDynamic(locale, 'arcTextLocationService')]]</span>
class="parameter-section arc-tos-content"> <a href="#" id="learnMoreLinkLocationService"
<p id="google-service-confirmation-text" on-tap="onLocationServiceLearnMoreTap_">
i18n-values=".innerHTML:arcTextGoogleServiceConfirmation"></p> [[i18nDynamic(locale, 'arcLearnMoreText')]]
</div> </a>
<div id="arc-review-settings" class="parameter-section arc-tos-content"> </p>
<cr-checkbox id="arc-review-settings-checkbox"> </cr-checkbox>
<p i18n-values=".innerHTML:arcTextReviewSettings"></p> </div>
</cr-checkbox> <div id="arcPaiService" class="parameter-section arc-tos-content">
<p>
<span>[[i18nDynamic(locale, 'arcTextPaiService')]]</span>
<a href="#" id="learnMoreLinkPai"
on-tap="onPaiLearnMoreTap_">
[[i18nDynamic(locale, 'arcLearnMoreText')]]
</a>
</p>
</div>
<div id="arcGoogleServiceConfirmation"
class="parameter-section arc-tos-content">
<p>[[i18nDynamic(locale, googleServiceConfirmationTextKey)]]</p>
</div>
<div id="arcReviewSettings"
class="parameter-section arc-tos-content"
hidden="[[demoMode]]">
<cr-checkbox id="arcReviewSettingsCheckbox"
checked="{{reviewSettings}}">
<p>[[i18nDynamic(locale, 'arcTextReviewSettings')]]</p>
</cr-checkbox>
</div>
</div> </div>
<div class="arc-tos-loading"> <div class="arc-tos-loading">
<p>[[i18nDynamic(locale, 'arcTermsOfServiceLoading')]]</p> <p>[[i18nDynamic(locale, 'arcTermsOfServiceLoading')]]</p>
...@@ -63,26 +102,77 @@ ...@@ -63,26 +102,77 @@
</div> </div>
</div> </div>
<div slot="bottom-buttons" class="flex layout horizontal"> <div slot="bottom-buttons" class="flex layout horizontal">
<oobe-back-button id="arc-tos-back-button" <oobe-back-button id="arcTosBackButton" hidden="[[!demoMode]]"
on-click="onBack_"></oobe-back-button> on-click="onBack_"></oobe-back-button>
<div class="flex"> <div class="flex">
</div> </div>
<oobe-text-button id="arc-tos-skip-button" border on-tap="onSkip_" <oobe-text-button id="arcTosRetryButton"
disabled="[[arcTosButtonsDisabled]]"
text-key="arcTermsOfServiceSkipButton"></oobe-text-button>
<oobe-text-button id="arc-tos-retry-button"
inverse on-tap="onRetry_" inverse on-tap="onRetry_"
disabled="[[arcTosButtonsDisabled]]" disabled="[[arcTosButtonsDisabled]]"
text-key="arcTermsOfServiceRetryButton"></oobe-text-button> text-key="arcTermsOfServiceRetryButton"></oobe-text-button>
<oobe-text-button id="arc-tos-next-button" <oobe-text-button id="arcTosNextButton"
inverse on-tap="onNext_" inverse on-tap="onNext_"
disabled="[[arcTosButtonsDisabled]]" disabled="[[arcTosButtonsDisabled]]"
hidden="[[showFullDialog]]"
text-key="arcTermsOfServiceNextButton"></oobe-text-button> text-key="arcTermsOfServiceNextButton"></oobe-text-button>
<oobe-text-button id="arc-tos-accept-button" <oobe-text-button id="arcTosAcceptButton"
inverse on-tap="onAccept_" inverse on-tap="onAccept_"
disabled="[[arcTosButtonsDisabled]]" disabled="[[arcTosButtonsDisabled]]"
text-key="arcTermsOfServiceAcceptButton"></oobe-text-button> hidden="[[!showFullDialog]]"
text-key="[[acceptTextKey]]"></oobe-text-button>
</div> </div>
</oobe-dialog> </oobe-dialog>
<oobe-help-dialog id="arcMetricsPopup" on-close="onOverlayClosed_"
title-key="arcLearnMoreStatisticsTitle">
<div slot="content">
<p>[[i18nDynamic(locale, 'arcLearnMoreStatisticsP1')]]</p>
<p>[[i18nDynamic(locale, 'arcLearnMoreStatisticsP2')]]</p>
<p>[[i18nDynamic(locale, 'arcLearnMoreStatisticsP3')]]</p>
<p>[[i18nDynamic(locale, 'arcLearnMoreStatisticsP4')]]</p>
</div>
</oobe-help-dialog>
<oobe-help-dialog id="arcBackupRestorePopup" on-close="onOverlayClosed_"
title-key="arcLearnMoreBackupAndRestoreTitle">
<div slot="content">
<p>[[i18nDynamic(locale, 'arcLearnMoreBackupAndRestoreP1')]]</p>
<p>[[i18nDynamic(locale, 'arcLearnMoreBackupAndRestoreP2')]]</p>
<p>[[i18nDynamic(locale, 'arcLearnMoreBackupAndRestoreP3')]]</p>
<p>[[i18nDynamic(locale, 'arcLearnMoreBackupAndRestoreP4')]]</p>
<p>[[i18nDynamic(locale, 'arcLearnMoreBackupAndRestoreP5')]]</p>
</div>
</oobe-help-dialog>
<oobe-help-dialog id="arcBackupRestoreChildPopup"
on-close="onOverlayClosed_"
title-key="arcLearnMoreBackupAndRestoreTitle">
<div slot="content">
<p>[[i18nDynamic(locale, 'arcLearnMoreBackupAndRestoreChildP1')]]</p>
<p>[[i18nDynamic(locale, 'arcLearnMoreBackupAndRestoreChildP2')]]</p>
<p>[[i18nDynamic(locale, 'arcLearnMoreBackupAndRestoreChildP3')]]</p>
</div>
</oobe-help-dialog>
<oobe-help-dialog id="arcLocationServicePopup"
on-close="onOverlayClosed_"
title-key="arcLearnMoreLocationServiceTitle">
<div slot="content">
<p>[[i18nDynamic(locale, 'arcLearnMoreLocationServiceP1')]]</p>
<p>[[i18nDynamic(locale, 'arcLearnMoreLocationServiceP2')]]</p>
</div>
</oobe-help-dialog>
<oobe-help-dialog id="arcPaiPopup" on-close="onOverlayClosed_"
title-key="arcLearnMorePaiServiceTitle">
<div slot="content">
<p>[[i18nDynamic(locale, 'arcLearnMorePaiService')]]</p>
</div>
</oobe-help-dialog>
<oobe-help-dialog id="arcTosOverlayPrivacyPolicy"
on-close="onOverlayClosed_">
<div slot="content" id = "arcTosOverlayWebviewContainer">
<webview id="arcTosOverlayWebview" hidden="[[overlayLoading_]]">
</webview>
<throbber-notice class="flex layout center-justified vertical"
hidden="[[!overlayLoading_]]" style="height: 100%;">
</throbber-notice>
</div>
</oobe-help-dialog>
</template> </template>
</dom-module> </dom-module>
...@@ -26,14 +26,118 @@ Polymer({ ...@@ -26,14 +26,118 @@ Polymer({
* Reference to OOBE screen object. * Reference to OOBE screen object.
* @type {!{ * @type {!{
* onAccept: function(), * onAccept: function(),
* onNext: function(),
* onSkip: function(),
* reloadPlayStoreToS: function(), * reloadPlayStoreToS: function(),
* }} * }}
*/ */
screen: { screen: {
type: Object, type: Object,
}, },
/**
* Indicates whether metrics text should be hidden.
*/
isMetricsHidden: {
type: Boolean,
value: false,
},
/**
* String id for metrics collection text.
*/
metricsTextKey: {
type: String,
value: 'arcTextMetricsEnabled',
},
/**
* String id of Google service confirmation text.
*/
googleServiceConfirmationTextKey: {
type: String,
value: 'arcTextGoogleServiceConfirmation',
},
/**
* String id of text for Accept button.
*/
acceptTextKey: {
type: String,
value: 'arcTermsOfServiceAcceptButton',
},
/**
* Indicates whether backup and restore should be enabled.
*/
backupRestore: {
type: Boolean,
value: true,
},
/**
* Indicates whether backup and restore is managed.
* If backup and restore is managed, the checkbox will be disabled.
*/
backupRestoreManaged: {
type: Boolean,
value: false,
},
/**
* Indicates whether current account is child account.
*/
isChild: {
type: Boolean,
value: false,
},
/**
* Indicates whether location service should be enabled.
*/
locationService: {
type: Boolean,
value: true,
},
/**
* Indicates whether location service is managed.
* If location service is managed, the checkbox will be disabled.
*/
locationServiceManaged: {
type: Boolean,
value: false,
},
/**
* Indicates whether user will review Arc settings after login.
*/
reviewSettings: {
type: Boolean,
value: false,
},
/**
* Indicates whether user sees full content of terms of service.
*/
showFullDialog: {
type: Boolean,
value: false,
},
/**
* Indicates whether currently under demo mode.
*/
demoMode: {
type: Boolean,
value: false,
},
/**
* Indicates whether popup overlay webview is loading.
*/
overlayLoading_: {
type: Boolean,
value: true,
},
}, },
/** /**
...@@ -48,6 +152,13 @@ Polymer({ ...@@ -48,6 +152,13 @@ Polymer({
*/ */
is_shown_: false, is_shown_: false,
/**
* Last focused element when overlay is shown. Used to resume focus when
* overlay is dismissed.
* @private {Object|null}
*/
lastFocusedElement_: null,
/** Called when dialog is shown */ /** Called when dialog is shown */
onBeforeShow() { onBeforeShow() {
this.behaviors.forEach((behavior) => { this.behaviors.forEach((behavior) => {
...@@ -58,29 +169,35 @@ Polymer({ ...@@ -58,29 +169,35 @@ Polymer({
window.setTimeout(this.applyOobeConfiguration_.bind(this), 0); window.setTimeout(this.applyOobeConfiguration_.bind(this), 0);
}, },
/** /** Setups overlay webview loading callback */
* Returns element by its id. setupOverlay() {
*/ var self = this;
getElement(id) { this.$.arcTosOverlayWebview.addEventListener(
return this.$[id]; 'contentload', function() {
self.overlayLoading_ = false;
});
}, },
/** /**
* Returns focused element inside this element. * Opens external URL in popup overlay.
* @param {string} targetUrl to show in overlay webview.
* @param {boolean} isUsingOfflineTerm whether to use offline url.
*/ */
getActiveElement(id) { showUrlOverlay(targetUrl, isUsingOfflineTerm) {
return this.shadowRoot.activeElement; if (!isUsingOfflineTerm) {
this.$.arcTosOverlayWebview.src = targetUrl;
}
this.lastFocusedElement_ = this.shadowRoot.activeElement;
this.overlayLoading_ = true;
this.$.arcTosOverlayPrivacyPolicy.showDialog();
}, },
// TODO(crbug.com/1047807): This is a temporary quickfix to proceed with /**
// Polymer v2 migration. This screen should be reworked to avoid using * Returns element by its id.
// i18nTemplate.process call. */
i18nUpdateLocale() { getElement(id) {
this.behaviors.forEach((behavior) => { return this.$[id];
if (behavior.i18nUpdateLocale)
behavior.i18nUpdateLocale.call(this);
});
i18nTemplate.process(this.shadowRoot, loadTimeData);
}, },
/** /**
...@@ -134,7 +251,9 @@ Polymer({ ...@@ -134,7 +251,9 @@ Polymer({
* @private * @private
*/ */
onNext_() { onNext_() {
this.screen.onNext(); this.showFullDialog = true;
this.$.arcTosDialog.scrollToBottom();
this.$.arcTosAcceptButton.focus();
}, },
/** /**
...@@ -147,20 +266,62 @@ Polymer({ ...@@ -147,20 +266,62 @@ Polymer({
}, },
/** /**
* On-tap event handler for Skip button. * On-tap event handler for Back button.
* *
* @private * @private
*/ */
onSkip_() { onBack_() {
this.screen.onSkip(); chrome.send('login.ArcTermsOfServiceScreen.userActed', ['go-back']);
}, },
/** /**
* On-tap event handler for Back button. * On-tap event handler for metrics learn more link
*
* @private * @private
*/ */
onBack_() { onMetricsLearnMoreTap_() {
chrome.send('login.ArcTermsOfServiceScreen.userActed', ['go-back']); this.lastFocusedElement_ = this.shadowRoot.activeElement;
this.$.arcMetricsPopup.showDialog();
},
/**
* On-tap event handler for backup and restore learn more link
* @private
*/
onBackupRestoreLearnMoreTap_() {
this.lastFocusedElement_ = this.shadowRoot.activeElement;
if (this.isChild) {
this.$.arcBackupRestoreChildPopup.showDialog();
} else {
this.$.arcBackupRestorePopup.showDialog();
}
},
/**
* On-tap event handler for location service learn more link
* @private
*/
onLocationServiceLearnMoreTap_() {
this.lastFocusedElement_ = this.shadowRoot.activeElement;
this.$.arcLocationServicePopup.showDialog();
},
/**
* On-tap event handler for Play auto install learn more link
* @private
*/
onPaiLearnMoreTap_() {
this.lastFocusedElement_ = this.shadowRoot.activeElement;
this.$.arcPaiPopup.showDialog();
},
/*
* Callback when overlay is closed.
* @private
*/
onOverlayClosed_() {
if (this.lastFocusedElement_) {
this.lastFocusedElement_.focus();
this.lastFocusedElement_ = null;
}
} }
}); });
...@@ -53,7 +53,6 @@ ...@@ -53,7 +53,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_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">
<link rel="stylesheet" href="screen_password_changed.css"> <link rel="stylesheet" href="screen_password_changed.css">
......
...@@ -59,7 +59,6 @@ ...@@ -59,7 +59,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_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">
<link rel="stylesheet" href="screen_password_changed.css"> <link rel="stylesheet" href="screen_password_changed.css">
......
/* Copyright 2016 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-tos-overlay-content-text p {
text-align: justify;
}
#arc-tos-overlay-webview {
border: 1px solid #d9d9d9;
display: block;
height: 300px;
width: 100%;
}
#arc-tos-overlay-webview-container.overlay-loading > webview,
#arc-tos-overlay-webview-container:not(.overlay-loading) > div {
display: none;
}
#arc-tos-overlay-webview-container {
box-sizing: border-box;
height: 332px;
margin: auto;
padding: 24px 8px 8px 8px;
width: 100%;
}
...@@ -5,17 +5,4 @@ ...@@ -5,17 +5,4 @@
<div class="step right hidden arc-tos-loading" id="arc-tos" <div class="step right hidden arc-tos-loading" id="arc-tos"
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>
<oobe-help-dialog id="arc-tos-overlay-privacy-policy">
<div slot="content" id="arc-tos-overlay-webview-container" >
<webview id="arc-tos-overlay-webview"></webview>
<div class="flex layout center-justified vertical" style="height: 100%;">
<throbber-notice></throbber-notice>
</div>
</div>
</oobe-help-dialog>
<oobe-help-dialog id="arc-tos-overlay-learn-more">
<span slot="content" id="arc-learn-more-content"></span>
</oobe-help-dialog>
</div> </div>
...@@ -115,7 +115,6 @@ void ArcTermsOfServiceScreenHandler::DeclareLocalizedValues( ...@@ -115,7 +115,6 @@ void ArcTermsOfServiceScreenHandler::DeclareLocalizedValues(
IDS_ARC_OOBE_TERMS_DESCRIPTION); IDS_ARC_OOBE_TERMS_DESCRIPTION);
builder->Add("arcTermsOfServiceLoading", IDS_ARC_OOBE_TERMS_LOADING); builder->Add("arcTermsOfServiceLoading", IDS_ARC_OOBE_TERMS_LOADING);
builder->Add("arcTermsOfServiceError", IDS_ARC_OOBE_TERMS_LOAD_ERROR); builder->Add("arcTermsOfServiceError", IDS_ARC_OOBE_TERMS_LOAD_ERROR);
builder->Add("arcTermsOfServiceSkipButton", IDS_ARC_OOBE_TERMS_BUTTON_SKIP);
builder->Add("arcTermsOfServiceRetryButton", IDS_ARC_OOBE_TERMS_BUTTON_RETRY); builder->Add("arcTermsOfServiceRetryButton", IDS_ARC_OOBE_TERMS_BUTTON_RETRY);
builder->Add("arcTermsOfServiceAcceptButton", builder->Add("arcTermsOfServiceAcceptButton",
IDS_ARC_OOBE_TERMS_BUTTON_ACCEPT); IDS_ARC_OOBE_TERMS_BUTTON_ACCEPT);
...@@ -124,44 +123,84 @@ void ArcTermsOfServiceScreenHandler::DeclareLocalizedValues( ...@@ -124,44 +123,84 @@ void ArcTermsOfServiceScreenHandler::DeclareLocalizedValues(
builder->Add("arcTermsOfServiceNextButton", builder->Add("arcTermsOfServiceNextButton",
IDS_ARC_OPT_IN_DIALOG_BUTTON_NEXT); IDS_ARC_OPT_IN_DIALOG_BUTTON_NEXT);
builder->Add("arcPolicyLink", IDS_ARC_OPT_IN_PRIVACY_POLICY_LINK); builder->Add("arcPolicyLink", IDS_ARC_OPT_IN_PRIVACY_POLICY_LINK);
builder->Add("arcTextBackupRestore", builder->Add("arcTextBackupRestore", is_child_account_
is_child_account_ ? IDS_ARC_OPT_IN_DIALOG_BACKUP_RESTORE_CHILD ? IDS_ARC_OOBE_BACKUP_RESTORE_CHILD
: IDS_ARC_OPT_IN_DIALOG_BACKUP_RESTORE); : IDS_ARC_OOBE_BACKUP_RESTORE);
builder->Add("arcTextLocationService", builder->Add("arcTextLocationService",
is_child_account_ ? IDS_ARC_OPT_IN_LOCATION_SETTING_CHILD is_child_account_ ? IDS_ARC_OOBE_LOCATION_SETTING_CHILD
: IDS_ARC_OPT_IN_LOCATION_SETTING); : IDS_ARC_OOBE_LOCATION_SETTING);
builder->Add("arcTextPaiService", IDS_ARC_OPT_IN_PAI); builder->Add("arcTextPaiService", IDS_ARC_OOBE_PAI);
builder->Add("arcTextGoogleServiceConfirmation", builder->Add("arcTextGoogleServiceConfirmation",
IDS_ARC_OPT_IN_GOOGLE_SERVICE_CONFIRMATION); IDS_ARC_OPT_IN_GOOGLE_SERVICE_CONFIRMATION);
builder->Add("arcTextReviewSettings", IDS_ARC_REVIEW_SETTINGS); builder->Add("arcTextReviewSettings", IDS_ARC_REVIEW_SETTINGS);
builder->Add("arcTextMetricsEnabled",
IDS_ARC_OOBE_TERMS_DIALOG_METRICS_ENABLED);
builder->Add("arcTextMetricsDisabled",
IDS_ARC_OOBE_TERMS_DIALOG_METRICS_DISABLED);
builder->Add("arcTextMetricsManagedEnabled", builder->Add("arcTextMetricsManagedEnabled",
IDS_ARC_OOBE_TERMS_DIALOG_METRICS_MANAGED_ENABLED); IDS_ARC_OOBE_TERMS_DIALOG_METRICS_MANAGED_ENABLED);
builder->Add("arcTextMetricsManagedDisabled",
IDS_ARC_OOBE_TERMS_DIALOG_METRICS_MANAGED_DISABLED);
builder->Add("arcTextMetricsEnabledChild",
IDS_ARC_OOBE_TERMS_DIALOG_METRICS_ENABLED_CHILD);
builder->Add("arcTextMetricsDisabledChild",
IDS_ARC_OOBE_TERMS_DIALOG_METRICS_DISABLED_CHILD);
builder->Add("arcTextMetricsManagedEnabledChild",
IDS_ARC_OOBE_TERMS_DIALOG_METRICS_MANAGED_ENABLED_CHILD);
builder->Add("arcTextMetricsManagedDisabledChild",
IDS_ARC_OOBE_TERMS_DIALOG_METRICS_MANAGED_DISABLED_CHILD);
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", builder->Add("arcLearnMoreStatisticsTitle",
IDS_ARC_OPT_IN_LEARN_MORE_STATISTICS_TITLE); IDS_ARC_OPT_IN_LEARN_MORE_STATISTICS_TITLE);
builder->Add("arcLearnMoreStatistics", builder->Add("arcLearnMoreStatisticsP1",
is_child_account_ ? IDS_ARC_OPT_IN_LEARN_MORE_STATISTICS_CHILD is_child_account_ ? IDS_ARC_OPT_IN_LEARN_MORE_STATISTICS_CHILD_P1
: IDS_ARC_OPT_IN_LEARN_MORE_STATISTICS); : IDS_ARC_OPT_IN_LEARN_MORE_STATISTICS_P1);
builder->Add("arcLearnMoreStatisticsP2",
is_child_account_ ? IDS_ARC_OPT_IN_LEARN_MORE_STATISTICS_CHILD_P2
: IDS_ARC_OPT_IN_LEARN_MORE_STATISTICS_P2);
builder->Add("arcLearnMoreStatisticsP3",
is_child_account_ ? IDS_ARC_OPT_IN_LEARN_MORE_STATISTICS_CHILD_P3
: IDS_ARC_OPT_IN_LEARN_MORE_STATISTICS_P3);
builder->Add("arcLearnMoreStatisticsP4",
is_child_account_ ? IDS_ARC_OPT_IN_LEARN_MORE_STATISTICS_CHILD_P4
: IDS_ARC_OPT_IN_LEARN_MORE_STATISTICS_P4);
builder->Add("arcLearnMoreLocationServiceTitle", builder->Add("arcLearnMoreLocationServiceTitle",
IDS_ARC_OPT_IN_LEARN_MORE_LOCATION_SERVICES_TITLE); IDS_ARC_OPT_IN_LEARN_MORE_LOCATION_SERVICES_TITLE);
builder->Add("arcLearnMoreLocationService", builder->Add("arcLearnMoreLocationServiceP1",
is_child_account_ is_child_account_
? IDS_ARC_OPT_IN_LEARN_MORE_LOCATION_SERVICES_CHILD ? IDS_ARC_OPT_IN_LEARN_MORE_LOCATION_SERVICES_CHILD_P1
: IDS_ARC_OPT_IN_LEARN_MORE_LOCATION_SERVICES); : IDS_ARC_OPT_IN_LEARN_MORE_LOCATION_SERVICES_P1);
builder->Add("arcLearnMoreLocationServiceP2",
is_child_account_
? IDS_ARC_OPT_IN_LEARN_MORE_LOCATION_SERVICES_CHILD_P2
: IDS_ARC_OPT_IN_LEARN_MORE_LOCATION_SERVICES_P2);
builder->Add("arcLearnMoreBackupAndRestoreTitle", builder->Add("arcLearnMoreBackupAndRestoreTitle",
IDS_ARC_OPT_IN_LEARN_MORE_BACKUP_AND_RESTORE_TITLE); IDS_ARC_OPT_IN_LEARN_MORE_BACKUP_AND_RESTORE_TITLE);
builder->Add("arcLearnMoreBackupAndRestore", builder->Add("arcLearnMoreBackupAndRestoreP1",
is_child_account_ IDS_ARC_OPT_IN_LEARN_MORE_BACKUP_AND_RESTORE_P1);
? IDS_ARC_OPT_IN_LEARN_MORE_BACKUP_AND_RESTORE_CHILD builder->Add("arcLearnMoreBackupAndRestoreP2",
: IDS_ARC_OPT_IN_LEARN_MORE_BACKUP_AND_RESTORE); IDS_ARC_OPT_IN_LEARN_MORE_BACKUP_AND_RESTORE_P2);
builder->Add("arcLearnMoreBackupAndRestoreP3",
IDS_ARC_OPT_IN_LEARN_MORE_BACKUP_AND_RESTORE_P3);
builder->Add("arcLearnMoreBackupAndRestoreP4",
IDS_ARC_OPT_IN_LEARN_MORE_BACKUP_AND_RESTORE_P4);
builder->Add("arcLearnMoreBackupAndRestoreP5",
IDS_ARC_OPT_IN_LEARN_MORE_BACKUP_AND_RESTORE_P5);
builder->Add("arcLearnMoreBackupAndRestoreChildP1",
IDS_ARC_OPT_IN_LEARN_MORE_BACKUP_AND_RESTORE_CHILD_P1);
builder->Add("arcLearnMoreBackupAndRestoreChildP2",
IDS_ARC_OPT_IN_LEARN_MORE_BACKUP_AND_RESTORE_CHILD_P2);
builder->Add("arcLearnMoreBackupAndRestoreChildP3",
IDS_ARC_OPT_IN_LEARN_MORE_BACKUP_AND_RESTORE_CHILD_P3);
builder->Add("arcLearnMorePaiServiceTitle", builder->Add("arcLearnMorePaiServiceTitle",
IDS_ARC_OPT_IN_LEARN_MORE_PAI_SERVICE_TITLE); 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_OOBE_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("oobeModalDialogClose", IDS_CHROMEOS_OOBE_CLOSE_DIALOG);
builder->Add("arcOverlayLoading", IDS_ARC_POPUP_HELP_LOADING); builder->Add("arcOverlayLoading", IDS_ARC_POPUP_HELP_LOADING);
builder->Add("arcLearnMoreText", IDS_ARC_OPT_IN_DIALOG_LEARN_MORE_LINK_TEXT);
} }
void ArcTermsOfServiceScreenHandler::OnMetricsModeChanged(bool enabled, void ArcTermsOfServiceScreenHandler::OnMetricsModeChanged(bool enabled,
...@@ -181,27 +220,24 @@ void ArcTermsOfServiceScreenHandler::OnMetricsModeChanged(bool enabled, ...@@ -181,27 +220,24 @@ void ArcTermsOfServiceScreenHandler::OnMetricsModeChanged(bool enabled,
// managed flag. // managed flag.
const bool owner_profile = !owner.is_valid() || user->GetAccountId() == owner; const bool owner_profile = !owner.is_valid() || user->GetAccountId() == owner;
int message_id; std::string message;
if (owner_profile && !managed) { if (owner_profile && !managed) {
if (is_child_account_) { if (is_child_account_) {
message_id = enabled ? IDS_ARC_OOBE_TERMS_DIALOG_METRICS_ENABLED_CHILD message = enabled ? "arcTextMetricsEnabledChild"
: IDS_ARC_OOBE_TERMS_DIALOG_METRICS_DISABLED_CHILD; : "arcTextMetricsDisabledChild";
} else { } else {
message_id = enabled ? IDS_ARC_OOBE_TERMS_DIALOG_METRICS_ENABLED message = enabled ? "arcTextMetricsEnabled" : "arcTextMetricsDisabled";
: IDS_ARC_OOBE_TERMS_DIALOG_METRICS_DISABLED;
} }
} else { } else {
if (is_child_account_) { if (is_child_account_) {
message_id = message = enabled ? "arcTextMetricsManagedEnabledChild"
enabled ? IDS_ARC_OOBE_TERMS_DIALOG_METRICS_MANAGED_ENABLED_CHILD : "arcTextMetricsManagedDisabledChild";
: IDS_ARC_OOBE_TERMS_DIALOG_METRICS_MANAGED_DISABLED_CHILD;
} else { } else {
message_id = enabled ? IDS_ARC_OOBE_TERMS_DIALOG_METRICS_MANAGED_ENABLED message = enabled ? "arcTextMetricsManagedEnabled"
: IDS_ARC_OOBE_TERMS_DIALOG_METRICS_MANAGED_DISABLED; : "arcTextMetricsManagedDisabled";
} }
} }
CallJS("login.ArcTermsOfServiceScreen.setMetricsMode", CallJS("login.ArcTermsOfServiceScreen.setMetricsMode", message, true);
l10n_util::GetStringUTF16(message_id), true);
} }
void ArcTermsOfServiceScreenHandler::OnBackupAndRestoreModeChanged( void ArcTermsOfServiceScreenHandler::OnBackupAndRestoreModeChanged(
...@@ -298,7 +334,8 @@ void ArcTermsOfServiceScreenHandler::DoShow() { ...@@ -298,7 +334,8 @@ void ArcTermsOfServiceScreenHandler::DoShow() {
ShowScreen(kScreenId); ShowScreen(kScreenId);
arc_managed_ = arc::IsArcPlayStoreEnabledPreferenceManagedForProfile(profile); arc_managed_ = arc::IsArcPlayStoreEnabledPreferenceManagedForProfile(profile);
CallJS("login.ArcTermsOfServiceScreen.setArcManaged", arc_managed_); CallJS("login.ArcTermsOfServiceScreen.setArcManaged", arc_managed_,
is_child_account_);
MaybeLoadPlayStoreToS(true); MaybeLoadPlayStoreToS(true);
StartNetworkAndTimeZoneObserving(); StartNetworkAndTimeZoneObserving();
......
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