Commit 322be03c authored by Danila Kuzmin's avatar Danila Kuzmin Committed by Commit Bot

oobe: Migrate EulaScreen to LoginScreenBehavior

Bug: 1106367
Change-Id: Idcb023a623bd230eeba79618162ee47d6c0c5181
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2303717Reviewed-by: default avatarDenis Kuznetsov [CET] <antrim@chromium.org>
Commit-Queue: Danila Kuzmin <dkuzmin@google.com>
Cr-Commit-Position: refs/heads/master@{#795072}
parent b6f48f5b
...@@ -75,14 +75,13 @@ const test::UIPath kAcceptEulaButton = {"oobe-eula-md", "acceptButton"}; ...@@ -75,14 +75,13 @@ const test::UIPath kAcceptEulaButton = {"oobe-eula-md", "acceptButton"};
const test::UIPath kEulaTPMPassword = {"oobe-eula-md", "eula-password"}; const test::UIPath kEulaTPMPassword = {"oobe-eula-md", "eula-password"};
const test::UIPath kUsageStats = {"oobe-eula-md", "usageStats"}; const test::UIPath kUsageStats = {"oobe-eula-md", "usageStats"};
const test::UIPath kAdditionalTermsLink = {"oobe-eula-md", "additionalTerms"}; const test::UIPath kAdditionalTermsLink = {"oobe-eula-md", "additionalTerms"};
const test::UIPath kAdditionalTermsDialog = {"oobe-eula-md", "additional-tos"}; const test::UIPath kAdditionalTermsDialog = {"oobe-eula-md", "additionalToS"};
const test::UIPath kAdditionalTermsClose = {"oobe-eula-md", const test::UIPath kAdditionalTermsClose = {"oobe-eula-md",
"close-additional-tos"}; "close-additional-tos"};
const test::UIPath kInstallationSettingsLink = {"oobe-eula-md", const test::UIPath kSecuritySettingsLink = {"oobe-eula-md", "securitySettings"};
"installationSettings"}; const test::UIPath kSecuritySettingsDialog = {"oobe-eula-md",
const test::UIPath kInstallationSettingsDialog = {"oobe-eula-md", "securitySettingsDialog"};
"installationSettingsDialog"}; const test::UIPath kLearnMoreLink = {"oobe-eula-md", "learnMore"};
const test::UIPath kLearnMoreLink = {"oobe-eula-md", "learn-more"};
// Helper class to wait until the WebCotnents finishes loading. // Helper class to wait until the WebCotnents finishes loading.
class WebContentsLoadFinishedWaiter : public content::WebContentsObserver { class WebContentsLoadFinishedWaiter : public content::WebContentsObserver {
...@@ -320,8 +319,8 @@ IN_PROC_BROWSER_TEST_F(EulaTest, DisplaysTpmPassword) { ...@@ -320,8 +319,8 @@ IN_PROC_BROWSER_TEST_F(EulaTest, DisplaysTpmPassword) {
base::HistogramTester histogram_tester; base::HistogramTester histogram_tester;
ShowEulaScreen(); ShowEulaScreen();
test::OobeJS().TapLinkOnPath(kInstallationSettingsLink); test::OobeJS().TapLinkOnPath(kSecuritySettingsLink);
test::OobeJS().ExpectVisiblePath(kInstallationSettingsDialog); test::OobeJS().ExpectVisiblePath(kSecuritySettingsDialog);
test::OobeJS() test::OobeJS()
.CreateWaiter( .CreateWaiter(
......
...@@ -149,7 +149,17 @@ void EulaScreen::OnUserAction(const std::string& action_id) { ...@@ -149,7 +149,17 @@ void EulaScreen::OnUserAction(const std::string& action_id) {
return; return;
} }
RecordUserAction(action_id); RecordUserAction(action_id);
if (action_id == kUserActionAcceptButtonClicked) { if (action_id == kUserActionShowStatsUsageLearnMore) {
ShowStatsUsageLearnMore();
} else if (action_id == kUserActionShowAdditionalTos) {
ShowAdditionalTosDialog();
} else if (action_id == kUserActionShowSecuritySettings) {
InitiatePasswordFetch();
} else if (action_id == kUserActionSelectStatsUsage) {
SetUsageStatsEnabled(true);
} else if (action_id == kUserActionUnselectStatsUsage) {
SetUsageStatsEnabled(false);
} else if (action_id == kUserActionAcceptButtonClicked) {
exit_callback_.Run(g_usage_statistics_reporting_enabled exit_callback_.Run(g_usage_statistics_reporting_enabled
? Result::ACCEPTED_WITH_USAGE_STATS_REPORTING ? Result::ACCEPTED_WITH_USAGE_STATS_REPORTING
: Result::ACCEPTED_WITHOUT_USAGE_STATS_REPORTING); : Result::ACCEPTED_WITHOUT_USAGE_STATS_REPORTING);
...@@ -172,4 +182,14 @@ void EulaScreen::OnPasswordFetched(const std::string& tpm_password) { ...@@ -172,4 +182,14 @@ void EulaScreen::OnPasswordFetched(const std::string& tpm_password) {
view_->OnPasswordFetched(tpm_password_); view_->OnPasswordFetched(tpm_password_);
} }
void EulaScreen::ShowStatsUsageLearnMore() {
if (view_)
view_->ShowStatsUsageLearnMore();
}
void EulaScreen::ShowAdditionalTosDialog() {
if (view_)
view_->ShowAdditionalTosDialog();
}
} // namespace chromeos } // namespace chromeos
...@@ -81,6 +81,8 @@ class EulaScreen : public BaseScreen, public TpmPasswordFetcherDelegate { ...@@ -81,6 +81,8 @@ class EulaScreen : public BaseScreen, public TpmPasswordFetcherDelegate {
// TpmPasswordFetcherDelegate implementation: // TpmPasswordFetcherDelegate implementation:
void OnPasswordFetched(const std::string& tpm_password) override; void OnPasswordFetched(const std::string& tpm_password) override;
void ShowStatsUsageLearnMore();
void ShowAdditionalTosDialog();
// URL of the OEM EULA page (on disk). // URL of the OEM EULA page (on disk).
GURL oem_eula_page_; GURL oem_eula_page_;
......
...@@ -36,6 +36,8 @@ class MockEulaView : public EulaView { ...@@ -36,6 +36,8 @@ class MockEulaView : public EulaView {
MOCK_METHOD(void, MockBind, (EulaScreen * screen)); MOCK_METHOD(void, MockBind, (EulaScreen * screen));
MOCK_METHOD(void, MockUnbind, ()); MOCK_METHOD(void, MockUnbind, ());
MOCK_METHOD(void, OnPasswordFetched, (const std::string& tpm_password)); MOCK_METHOD(void, OnPasswordFetched, (const std::string& tpm_password));
MOCK_METHOD(void, ShowStatsUsageLearnMore, ());
MOCK_METHOD(void, ShowAdditionalTosDialog, ());
private: private:
EulaScreen* screen_ = nullptr; EulaScreen* screen_ = nullptr;
......
...@@ -216,6 +216,8 @@ js_library("oobe_enable_kiosk") { ...@@ -216,6 +216,8 @@ js_library("oobe_enable_kiosk") {
js_library("oobe_eula") { js_library("oobe_eula") {
deps = [ deps = [
":web_view_helper",
"components:login_screen_behavior",
"components:oobe_dialog", "components:oobe_dialog",
"components:oobe_dialog_host_behavior", "components:oobe_dialog_host_behavior",
"components:oobe_i18n_behavior", "components:oobe_i18n_behavior",
...@@ -284,3 +286,6 @@ js_library("throbber_notice") { ...@@ -284,3 +286,6 @@ js_library("throbber_notice") {
js_library("update_required_card") { js_library("update_required_card") {
} }
js_library("web_view_helper") {
}
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
// <include src="oobe_screen_demo_setup.js"> // <include src="oobe_screen_demo_setup.js">
// <include src="oobe_screen_demo_preferences.js"> // <include src="oobe_screen_demo_preferences.js">
// <include src="oobe_screen_enable_debugging.js"> // <include src="oobe_screen_enable_debugging.js">
// <include src="oobe_screen_eula.js">
// <include src="multi_tap_detector.js"> // <include src="multi_tap_detector.js">
// <include src="web_view_helper.js"> // <include src="web_view_helper.js">
...@@ -50,7 +49,6 @@ cr.define('cr.ui.Oobe', function() { ...@@ -50,7 +49,6 @@ cr.define('cr.ui.Oobe', function() {
*/ */
initialize() { initialize() {
cr.ui.login.DisplayManager.initialize(); cr.ui.login.DisplayManager.initialize();
login.EulaScreen.register();
login.AutoEnrollmentCheckScreen.register(); login.AutoEnrollmentCheckScreen.register();
login.EnableDebuggingScreen.register(); login.EnableDebuggingScreen.register();
login.AutolaunchScreen.register(); login.AutolaunchScreen.register();
......
...@@ -17,7 +17,7 @@ a { ...@@ -17,7 +17,7 @@ a {
height: 300px; height: 300px;
} }
#installationSettings, #securitySettings,
#logging { #logging {
font-size: 13px; font-size: 13px;
min-height: unset; min-height: unset;
...@@ -28,7 +28,7 @@ a { ...@@ -28,7 +28,7 @@ a {
} }
#additionalTerms, #additionalTerms,
#installationSettings, #securitySettings,
#logging { #logging {
margin-top: 16px; margin-top: 16px;
} }
...@@ -65,6 +65,6 @@ cr-checkbox { ...@@ -65,6 +65,6 @@ cr-checkbox {
user-select: text; user-select: text;
} }
.installation-settings-spinner { .security-settings-spinner {
margin-inline-end: 5px; margin-inline-end: 5px;
} }
...@@ -40,10 +40,10 @@ ...@@ -40,10 +40,10 @@
class="oobe-local-link"> class="oobe-local-link">
[[i18nDynamic(locale, 'oobeEulaAditionalTerms')]] [[i18nDynamic(locale, 'oobeEulaAditionalTerms')]]
</a> </a>
<a id="installationSettings" href="#" <a id="securitySettings" href="#"
class="oobe-local-link" class="oobe-local-link"
on-tap="onInstallationSettingsClicked_"> on-tap="onSecuritySettingsClicked_">
[[i18nDynamic(locale, 'eulaSystemInstallationSettings')]] [[i18nDynamic(locale, 'eulaSystemSecuritySettings')]]
</a> </a>
<div id="logging" class="layout horizontal"> <div id="logging" class="layout horizontal">
<cr-checkbox id="usageStats" class="layout start self-center" <cr-checkbox id="usageStats" class="layout start self-center"
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<span id="usageStatsLabel"> <span id="usageStatsLabel">
[[i18nDynamic(locale, 'checkboxLogging')]] [[i18nDynamic(locale, 'checkboxLogging')]]
</span> </span>
<a id="learn-more" href="#" <a id="learnMore" href="#"
on-tap="onUsageStatsHelpLinkClicked_" on-tap="onUsageStatsHelpLinkClicked_"
class="oobe-local-link"> class="oobe-local-link">
[[i18nDynamic(locale, 'learnMore')]] [[i18nDynamic(locale, 'learnMore')]]
...@@ -75,9 +75,9 @@ ...@@ -75,9 +75,9 @@
</oobe-text-button> </oobe-text-button>
</div> </div>
</oobe-dialog> </oobe-dialog>
<oobe-dialog id="installationSettingsDialog" role="dialog" has-buttons <oobe-dialog id="securitySettingsDialog" role="dialog" has-buttons
title-key="eulaSystemInstallationSettings" hidden title-key="eulaSystemSecuritySettings" hidden
aria-label$="[[i18nDynamic(locale, 'eulaSystemInstallationSettings')]]"> aria-label$="[[i18nDynamic(locale, 'eulaSystemSecuritySettings')]]">
<hd-iron-icon slot="oobe-icon" <hd-iron-icon slot="oobe-icon"
icon1x="oobe-32:googleg" icon2x="oobe-64:googleg"> icon1x="oobe-32:googleg" icon2x="oobe-64:googleg">
</hd-iron-icon> </hd-iron-icon>
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
</div> </div>
<div class="layout horizontal" <div class="layout horizontal"
hidden="[[!isWaitingForPassword_(password)]]"> hidden="[[!isWaitingForPassword_(password)]]">
<div class="installation-settings-spinner throbber"></div> <div class="security-settings-spinner throbber"></div>
<div> <div>
[[i18nDynamic(locale, 'eulaTpmBusy')]] [[i18nDynamic(locale, 'eulaTpmBusy')]]
</div> </div>
...@@ -111,11 +111,11 @@ ...@@ -111,11 +111,11 @@
<div class="flex"></div> <div class="flex"></div>
<oobe-text-button id="settings-close-button" inverse <oobe-text-button id="settings-close-button" inverse
class="focus-on-show" class="focus-on-show"
text-key="eulaSystemInstallationSettingsOkButton" text-key="eulaSystemSecuritySettingsOkButton"
on-tap="onInstallationSettingsCloseClicked_"></oobe-text-button> on-tap="onSecuritySettingsCloseClicked_"></oobe-text-button>
</div> </div>
</oobe-dialog> </oobe-dialog>
<cr-dialog id="additional-tos" ignore-popstate <cr-dialog id="additionalToS" ignore-popstate
on-close="focusAdditionalTermsLink_" on-close="focusAdditionalTermsLink_"
on-cancel="focusAdditionalTermsLink_"> on-cancel="focusAdditionalTermsLink_">
<div slot="title"> <div slot="title">
......
...@@ -2,6 +2,231 @@ ...@@ -2,6 +2,231 @@
// 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.
(function() {
const CLEAR_ANCHORS_CONTENT_SCRIPT = {
code: 'A=Array.from(document.getElementsByTagName("a"));' +
'for(var i = 0; i < A.length; ++i) {' +
' const el = A[i];' +
' let e = document.createElement("span");' +
' if (el.textContent.trim().length > 0) {' +
' e.textContent=el.textContent + "(" + el.href + ")";' +
' }' +
' el.parentNode.replaceChild(e,el);' +
'}'
};
const EULA_FONTS_CSS = {
code: `body * {
font-family: Roboto, sans-serif !important;
font-size: 13px !important;
background-color: transparent !important;
line-height: 20px !important;}
body {
background-color: transparent !important;
}
body h2 {
font-size: 15px !important;
line-height: 22px !important;}`
};
/**
* Timeout to load online Eula.
* @type {number}
*/
const ONLINE_EULA_LOAD_TIMEOUT_IN_MS = 7000;
/**
* Timeout between consequent loads of online Eula.
* @type {number}
*/
const ONLINE_EULA_RETRY_BACKOFF_TIMEOUT_IN_MS = 1000;
/**
* URL to use when online page is not available.
* @type {string}
*/
const TERMS_URL = 'chrome://terms';
// EulaLoader assists on the process of loading an URL into a webview.
// It listens for events from the webRequest API for the given URL and
// loads an offline version of the EULA in case of failure. Calling
// setURL() multiple times with the same URL while requests are being made
// won't affect current requests. Instead, it will mark the flag
// 'reloadRequested' for the given URL. The reload will be performed only
// if the current requests fail. This prevents webview-loadAbort events
// from being fired and unnecessary reloads.
class EulaLoader {
/**
* @suppress {missingProperties} as WebView type has no addContentScripts
*/
constructor(webview, timeout, load_offline_callback, clear_anchors) {
assert(webview.tagName === 'WEBVIEW');
// Do not create multiple loaders.
if (EulaLoader.instances[webview.id]) {
return EulaLoader.instances[webview.id];
}
this.webview_ = webview;
this.timeout_ = timeout;
this.isPerformingRequests_ = false;
this.reloadRequested_ = false;
this.loadOfflineCallback_ = load_offline_callback;
this.loadTimer_ = 0;
this.backOffTimer_ = 0;
this.url_ = '';
if (clear_anchors) {
// Add the CLEAR_ANCHORS_CONTENT_SCRIPT that will clear <a><\a>
// (anchors) in order to prevent any navigation in the webview itself.
webview.addContentScripts([{
name: 'clearAnchors',
matches: ['<all_urls>'],
js: CLEAR_ANCHORS_CONTENT_SCRIPT,
}]);
webview.addEventListener('contentload', () => {
webview.executeScript(CLEAR_ANCHORS_CONTENT_SCRIPT);
});
}
webview.addEventListener('contentload', () => {
webview.insertCSS(EULA_FONTS_CSS);
});
// Monitor webRequests API events
this.webview_.request.onCompleted.addListener(
this.onCompleted_.bind(this),
{urls: ['<all_urls>'], types: ['main_frame']});
this.webview_.request.onErrorOccurred.addListener(
this.onErrorOccurred_.bind(this),
{urls: ['<all_urls>'], types: ['main_frame']});
// The only instance of the EulaLoader.
EulaLoader.instances[webview.id] = this;
}
// Clears the internal state of the EULA loader. Stops the timeout timer
// and prevents events from being handled.
clearInternalState() {
window.clearTimeout(this.loadTimer_);
window.clearTimeout(this.backOffTimer_);
this.isPerformingRequests_ = false;
this.reloadRequested_ = false;
}
// Sets an URL to be loaded in the webview. If the URL is different from the
// previous one, it will be immediately loaded. If the URL is the same as
// the previous one, it will be reloaded. If requests are under way, the
// reload will be performed once the current requests are finished.
setUrl(url) {
assert(/^https?:\/\//.test(url));
if (url != this.url_) {
// Clear the internal state and start with a new URL.
this.clearInternalState();
this.url_ = url;
this.loadWithFallbackTimer();
} else {
// Same URL was requested again. Reload later if a request is under way.
if (this.isPerformingRequests_)
this.reloadRequested_ = true;
else
this.loadWithFallbackTimer();
}
}
// This method only gets invoked if the webview webRequest API does not
// fire either 'onErrorOccurred' or 'onCompleted' before the timer runs out.
// See: https://developer.chrome.com/extensions/webRequest
onTimeoutError_() {
// Return if we are no longer monitoring requests. Sanity check.
if (!this.isPerformingRequests_)
return;
if (this.reloadRequested_)
this.loadWithFallbackTimer();
else
this.tryLoadOffline();
}
// Loads the offline version of the EULA.
tryLoadOffline() {
this.clearInternalState();
if (this.loadOfflineCallback_)
this.loadOfflineCallback_();
}
/**
* Only process events for the current URL and when performing requests.
* @param {!Object} details
*/
shouldProcessEvent(details) {
return this.isPerformingRequests_ && (details.url === this.url_);
}
/**
* webRequest API Event Handler for 'onErrorOccurred'
* @param {!Object} details
*/
onErrorOccurred_(details) {
if (!this.shouldProcessEvent(details))
return;
if (this.reloadRequested_)
this.loadWithFallbackTimer();
else
this.loadAfterBackoff();
}
/**
* webRequest API Event Handler for 'onCompleted'
* @suppress {missingProperties} no statusCode for details
* @param {!Object} details
*/
onCompleted_(details) {
if (!this.shouldProcessEvent(details))
return;
// Http errors such as 4xx, 5xx hit here instead of 'onErrorOccurred'.
if (details.statusCode != 200) {
// Not a successful request. Perform a reload if requested.
if (this.reloadRequested_)
this.loadWithFallbackTimer();
else
this.loadAfterBackoff();
} else {
// Success!
this.clearInternalState();
}
}
// Loads the URL into the webview and starts a timer.
loadWithFallbackTimer() {
// Clear previous timer and perform a load.
window.clearTimeout(this.loadTimer_);
this.loadTimer_ =
window.setTimeout(this.onTimeoutError_.bind(this), this.timeout_);
this.tryLoadOnline();
}
loadAfterBackoff() {
window.clearTimeout(this.backOffTimer_);
this.backOffTimer_ = window.setTimeout(
this.tryLoadOnline.bind(this), ONLINE_EULA_RETRY_BACKOFF_TIMEOUT_IN_MS);
}
tryLoadOnline() {
this.reloadRequested_ = false;
// A request is being made
this.isPerformingRequests_ = true;
if (this.webview_.src === this.url_)
this.webview_.reload();
else
this.webview_.src = this.url_;
}
}
EulaLoader.instances = {};
/** /**
* @fileoverview Polymer element for displaying material design Terms Of Service * @fileoverview Polymer element for displaying material design Terms Of Service
* screen. * screen.
...@@ -10,7 +235,14 @@ ...@@ -10,7 +235,14 @@
Polymer({ Polymer({
is: 'oobe-eula-md', is: 'oobe-eula-md',
behaviors: [OobeI18nBehavior, OobeDialogHostBehavior], behaviors: [OobeI18nBehavior, OobeDialogHostBehavior, LoginScreenBehavior],
EXTERNAL_API: [
'setTpmPassword',
'setUsageStats',
'showAdditionalTosDialog',
'showSecuritySettingsDialog',
],
properties: { properties: {
/** /**
...@@ -38,23 +270,12 @@ Polymer({ ...@@ -38,23 +270,12 @@ Polymer({
}, },
/** /**
* The TPM password shown on the installation settings page. * The TPM password shown on the security settings page.
*/ */
password: { password: {
type: String, type: String,
value: null, value: null,
}, },
/**
* Reference to OOBE screen object.
* @type {!{
* loadEulaToWebview_: function(Element, string, boolean),
* onUsageStatsClicked_: function(boolean),
* }}
*/
screen: {
type: Object,
},
}, },
/** /**
...@@ -65,15 +286,22 @@ Polymer({ ...@@ -65,15 +286,22 @@ Polymer({
focus() { focus() {
if (this.eulaLoadingScreenShown) { if (this.eulaLoadingScreenShown) {
this.$.eulaLoadingDialog.show(); this.$.eulaLoadingDialog.focus();
} else { } else {
this.$.eulaDialog.show(); this.$.crosEulaFrame.focus();
} }
}, },
/** Called when dialog is shown */ /** Called just before the dialog is shown */
onBeforeShow() { onBeforeShow() {
window.setTimeout(this.initializeScreen_.bind(this), 0); window.setTimeout(this.initializeScreen_.bind(this), 0);
this.updateLocalizedContent();
},
ready() {
this.initializeLoginScreen('EulaScreen', {
resetAllowed: true,
});
}, },
/** /**
...@@ -114,20 +342,49 @@ Polymer({ ...@@ -114,20 +342,49 @@ Polymer({
this.$.eulaDialog.scrollToBottom(); this.$.eulaDialog.scrollToBottom();
}, },
/**
* Load Eula into the given webview. Online version is attempted first with
* a timeout. If it fails to load, fallback to chrome://terms. The loaded
* terms contents is then set to the webview via data url. Webview is
* used as a sandbox for both online and local contents. Data url is
* used for chrome://terms so that webview never needs to have the
* privileged webui bindings.
*
* @param {!Object} webview Webview element to host the terms.
* @param {!string} onlineEulaUrl
* @param {boolean} clear_anchors if true the script will clear anchors
* from the loaded page.
*/
loadEulaToWebview_(webview, onlineEulaUrl, clear_anchors) {
assert(webview.tagName === 'WEBVIEW');
var loadBundledEula = function() {
WebViewHelper.loadUrlContentToWebView(
webview, TERMS_URL, WebViewHelper.ContentType.HTML);
};
// Load online Eula with a timeout to fallback to the offline version.
// This won't construct multiple EulaLoaders. Single instance.
var eulaLoader = new EulaLoader(
webview, ONLINE_EULA_LOAD_TIMEOUT_IN_MS, loadBundledEula,
clear_anchors);
eulaLoader.setUrl(onlineEulaUrl);
},
/** /**
* This is called when strings are updated. * This is called when strings are updated.
*/ */
updateLocalizedContent(event) { updateLocalizedContent() {
// This forces frame to reload. // This forces frame to reload.
const onlineEulaUrl = loadTimeData.getString('eulaOnlineUrl'); const onlineEulaUrl = loadTimeData.getString('eulaOnlineUrl');
this.eulaLoadingScreenShown = true; this.eulaLoadingScreenShown = true;
this.screen.loadEulaToWebview_( this.loadEulaToWebview_(
this.$.crosEulaFrame, onlineEulaUrl, false /* clear_anchors */); this.$.crosEulaFrame, onlineEulaUrl, false /* clear_anchors */);
const additionalToSUrl = const additionalToSUrl =
loadTimeData.getString('eulaAdditionalToSOnlineUrl'); loadTimeData.getString('eulaAdditionalToSOnlineUrl');
this.screen.loadEulaToWebview_( this.loadEulaToWebview_(
this.$.additionalChromeToSFrame, additionalToSUrl, this.$.additionalChromeToSFrame, additionalToSUrl,
true /* clear_anchors */); true /* clear_anchors */);
this.i18nUpdateLocale(); this.i18nUpdateLocale();
...@@ -139,7 +396,7 @@ Polymer({ ...@@ -139,7 +396,7 @@ Polymer({
* @private * @private
*/ */
eulaAccepted_() { eulaAccepted_() {
chrome.send('login.EulaScreen.userActed', ['accept-button']); this.userActed('accept-button');
}, },
/** /**
...@@ -148,21 +405,26 @@ Polymer({ ...@@ -148,21 +405,26 @@ Polymer({
* @private * @private
*/ */
onUsageChanged_() { onUsageChanged_() {
if (this.$.usageStats.checked) { if (this.usageStatsChecked) {
chrome.send('login.EulaScreen.userActed', ['select-stats-usage']); this.userActed('select-stats-usage');
} else { } else {
chrome.send('login.EulaScreen.userActed', ['unselect-stats-usage']); this.userActed('unselect-stats-usage');
} }
this.screen.onUsageStatsClicked_(this.$.usageStats.checked);
}, },
/** /**
* @private * @private
*/ */
onAdditionalTermsClicked_() { onAdditionalTermsClicked_() {
chrome.send('login.EulaScreen.userActed', ['show-additional-tos']); this.userActed('show-additional-tos');
this.$['additional-tos'].showModal(); },
this.$['close-additional-tos'].focus();
/**
* Shows additional terms of service dialog.
*/
showAdditionalTosDialog() {
this.$.additionalToS.showModal();
this.$.additionalToS.focus();
}, },
/** /**
...@@ -171,7 +433,7 @@ Polymer({ ...@@ -171,7 +433,7 @@ Polymer({
* @private * @private
*/ */
hideToSDialog_() { hideToSDialog_() {
this.$['additional-tos'].close(); this.$.additionalToS.close();
}, },
/** /**
...@@ -182,28 +444,33 @@ Polymer({ ...@@ -182,28 +444,33 @@ Polymer({
}, },
/** /**
* On-tap event handler for installationSettings. * On-tap event handler for securitySettings.
* *
* @private * @private
*/ */
onInstallationSettingsClicked_() { onSecuritySettingsClicked_() {
chrome.send('login.EulaScreen.userActed', ['show-security-settings']); this.userActed('show-security-settings');
chrome.send('eulaOnInstallationSettingsPopupOpened'); },
/**
* Shows system security settings dialog.
*/
showSecuritySettingsDialog() {
this.$.eulaDialog.hidden = true; this.$.eulaDialog.hidden = true;
this.$.installationSettingsDialog.hidden = false; this.$.securitySettingsDialog.hidden = false;
this.$.installationSettingsDialog.show(); this.$.securitySettingsDialog.show();
}, },
/** /**
* On-tap event handler for the close button on installation settings page. * On-tap event handler for the close button on security settings page.
* *
* @private * @private
*/ */
onInstallationSettingsCloseClicked_() { onSecuritySettingsCloseClicked_() {
this.$.installationSettingsDialog.hidden = true; this.$.securitySettingsDialog.hidden = true;
this.$.eulaDialog.hidden = false; this.$.eulaDialog.hidden = false;
this.$.eulaDialog.show(); this.$.eulaDialog.show();
this.$.installationSettings.focus(); this.$.securitySettings.focus();
}, },
/** /**
...@@ -212,9 +479,8 @@ Polymer({ ...@@ -212,9 +479,8 @@ Polymer({
* @private * @private
*/ */
onUsageStatsHelpLinkClicked_(e) { onUsageStatsHelpLinkClicked_(e) {
chrome.send('login.EulaScreen.userActed', ['show-stats-usage-learn-more']); this.userActed('show-stats-usage-learn-more');
this.$['learn-more'].focus(); this.$.learnMore.focus();
chrome.send('eulaOnLearnMore');
e.stopPropagation(); e.stopPropagation();
}, },
...@@ -224,7 +490,7 @@ Polymer({ ...@@ -224,7 +490,7 @@ Polymer({
* @private * @private
*/ */
onEulaBackButtonPressed_() { onEulaBackButtonPressed_() {
chrome.send('login.EulaScreen.userActed', ['back-button']); this.userActed('back-button');
}, },
/** /**
...@@ -244,4 +510,28 @@ Polymer({ ...@@ -244,4 +510,28 @@ Polymer({
isPasswordEmpty_(password) { isPasswordEmpty_(password) {
return password != null && password.length == 0; return password != null && password.length == 0;
}, },
/**
* Sets TPM password.
* @param {string} password TPM password to be shown.
*/
setTpmPassword(password) {
this.password = password;
},
/**
* Sets usage statistics checkbox.
* @param {boolean} checked Is the checkbox checked?
*/
setUsageStats(checked) {
this.usageStatsChecked = checked;
},
/**
* Called when focus is returned.
*/
onFocusReturned() {
this.focus();
},
}); });
})();
<div class="step hidden" id="eula" role="group"
i18n-values="aria-label:eulaScreenAccessibleTitle" hidden>
<oobe-eula-md id="oobe-eula-md"></oobe-eula-md>
</div>
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @fileoverview Oobe eula screen implementation.
*/
login.createScreen('EulaScreen', 'eula', function() {
const CLEAR_ANCHORS_CONTENT_SCRIPT = {
code: 'A=Array.from(document.getElementsByTagName("a"));' +
'for(var i = 0; i < A.length; ++i) {' +
' const el = A[i];' +
' let e = document.createElement("span");' +
' if (el.textContent.trim().length > 0) {' +
' e.textContent=el.textContent + "(" + el.href + ")";' +
' }' +
' el.parentNode.replaceChild(e,el);' +
'}'
};
const EULA_FONTS_CSS = {
code: `body * {
font-family: Roboto, sans-serif !important;
font-size: 13px !important;
background-color: transparent !important;
line-height: 20px !important;}
body {
background-color: transparent !important;
}
body h2 {
font-size: 15px !important;
line-height: 22px !important;}`
};
/**
* Timeout to load online Eula.
* @type {number}
*/
const ONLINE_EULA_LOAD_TIMEOUT_IN_MS = 7000;
/**
* Timeout between consequent loads of online Eula.
* @type {number}
*/
const ONLINE_EULA_RETRY_BACKOFF_TIMEOUT_IN_MS = 1000;
/**
* URL to use when online page is not available.
* @type {string}
*/
const TERMS_URL = 'chrome://terms';
// EulaLoader assists on the process of loading an URL into a webview.
// It listens for events from the webRequest API for the given URL and
// loads an offline version of the EULA in case of failure. Calling
// setURL() multiple times with the same URL while requests are being made
// won't affect current requests. Instead, it will mark the flag
// 'reloadRequested' for the given URL. The reload will be performed only
// if the current requests fail. This prevents webview-loadAbort events
// from being fired and unnecessary reloads.
class EulaLoader {
constructor(webview, timeout, load_offline_callback, clear_anchors) {
assert(webview.tagName === 'WEBVIEW');
// Do not create multiple loaders.
if (EulaLoader.instances[webview.id]) {
return EulaLoader.instances[webview.id];
}
this.webview_ = webview;
this.timeout_ = timeout;
this.isPerformingRequests_ = false;
this.reloadRequested_ = false;
this.loadOfflineCallback_ = load_offline_callback;
this.loadTimer_ = 0;
this.backOffTimer_ = 0;
if (clear_anchors) {
// Add the CLEAR_ANCHORS_CONTENT_SCRIPT that will clear <a><\a>
// (anchors) in order to prevent any navigation in the webview itself.
webview.addContentScripts([{
name: 'clearAnchors',
matches: ['<all_urls>'],
js: CLEAR_ANCHORS_CONTENT_SCRIPT,
}]);
webview.addEventListener('contentload', () => {
webview.executeScript(CLEAR_ANCHORS_CONTENT_SCRIPT);
});
}
webview.addEventListener('contentload', () => {
webview.insertCSS(EULA_FONTS_CSS);
});
// Monitor webRequests API events
this.webview_.request.onCompleted.addListener(
this.onCompleted_.bind(this),
{urls: ['<all_urls>'], types: ['main_frame']});
this.webview_.request.onErrorOccurred.addListener(
this.onErrorOccurred_.bind(this),
{urls: ['<all_urls>'], types: ['main_frame']});
// The only instance of the EulaLoader.
EulaLoader.instances[webview.id] = this;
}
// Clears the internal state of the EULA loader. Stops the timeout timer
// and prevents events from being handled.
clearInternalState() {
window.clearTimeout(this.loadTimer_);
window.clearTimeout(this.backOffTimer_);
this.isPerformingRequests_ = false;
this.reloadRequested_ = false;
}
// Sets an URL to be loaded in the webview. If the URL is different from the
// previous one, it will be immediately loaded. If the URL is the same as
// the previous one, it will be reloaded. If requests are under way, the
// reload will be performed once the current requests are finished.
setUrl(url) {
assert(/^https?:\/\//.test(url));
if (url != this.url_) {
// Clear the internal state and start with a new URL.
this.clearInternalState();
this.url_ = url;
this.loadWithFallbackTimer();
} else {
// Same URL was requested again. Reload later if a request is under way.
if (this.isPerformingRequests_)
this.reloadRequested_ = true;
else
this.loadWithFallbackTimer();
}
}
// This method only gets invoked if the webview webRequest API does not
// fire either 'onErrorOccurred' or 'onCompleted' before the timer runs out.
// See: https://developer.chrome.com/extensions/webRequest
onTimeoutError_() {
// Return if we are no longer monitoring requests. Sanity check.
if (!this.isPerformingRequests_)
return;
if (this.reloadRequested_)
this.loadWithFallbackTimer();
else
this.tryLoadOffline();
}
// Loads the offline version of the EULA.
tryLoadOffline() {
this.clearInternalState();
if (this.loadOfflineCallback_)
this.loadOfflineCallback_();
}
// Only process events for the current URL and when performing requests.
shouldProcessEvent(details) {
return this.isPerformingRequests_ && (details.url === this.url_);
}
// webRequest API Event Handler for 'onErrorOccurred'
onErrorOccurred_(details) {
if (!this.shouldProcessEvent(details))
return;
if (this.reloadRequested_)
this.loadWithFallbackTimer();
else
this.loadAfterBackoff();
}
// webRequest API Event Handler for 'onCompleted'
onCompleted_(details) {
if (!this.shouldProcessEvent(details))
return;
// Http errors such as 4xx, 5xx hit here instead of 'onErrorOccurred'.
if (details.statusCode != 200) {
// Not a successful request. Perform a reload if requested.
if (this.reloadRequested_)
this.loadWithFallbackTimer();
else
this.loadAfterBackoff();
} else {
// Success!
this.clearInternalState();
}
}
// Loads the URL into the webview and starts a timer.
loadWithFallbackTimer() {
// Clear previous timer and perform a load.
window.clearTimeout(this.loadTimer_);
this.loadTimer_ =
window.setTimeout(this.onTimeoutError_.bind(this), this.timeout_);
this.tryLoadOnline();
}
loadAfterBackoff() {
window.clearTimeout(this.backOffTimer_);
this.backOffTimer_ = window.setTimeout(
this.tryLoadOnline.bind(this),
ONLINE_EULA_RETRY_BACKOFF_TIMEOUT_IN_MS);
}
tryLoadOnline() {
this.reloadRequested_ = false;
// A request is being made
this.isPerformingRequests_ = true;
if (this.webview_.src === this.url_)
this.webview_.reload();
else
this.webview_.src = this.url_;
}
}
EulaLoader.instances = {};
return {
EXTERNAL_API: [
'setTpmPassword',
'setUsageStats',
],
/** @override */
decorate() {
$('oobe-eula-md').screen = this;
},
/**
* Called from $('oobe-eula-md') onUsageChanged handler.
* @param {boolean} value $('usage-stats').checked value.
*/
onUsageStatsClicked_(value) {
chrome.send('EulaScreen.usageStatsEnabled', [value]);
},
/**
* Event handler that is invoked just before the screen is shown.
* @param {object} data Screen init payload.
*/
onBeforeShow() {
this.updateLocalizedContent();
},
/**
* Returns a control which should receive an initial focus.
*/
get defaultControl() {
return $('oobe-eula-md');
},
enableKeyboardFlow() {},
/**
* Updates localized content of the screen that is not updated via template.
*/
updateLocalizedContent() {
// Reload the terms contents.
$('oobe-eula-md').updateLocalizedContent();
},
/**
* Sets TPM password.
* @param {text} password TPM password to be shown.
*/
setTpmPassword(password) {
$('oobe-eula-md').password = password;
},
/**
* Sets usage statistics checkbox.
* @param {boolean} checked Is the checkbox checked?
*/
setUsageStats(checked) {
$('oobe-eula-md').usageStatsChecked = checked;
},
/**
* Load Eula into the given webview. Online version is attempted first with
* a timeout. If it fails to load, fallback to chrome://terms. The loaded
* terms contents is then set to the webview via data url. Webview is
* used as a sandbox for both online and local contents. Data url is
* used for chrome://terms so that webview never needs to have the
* privileged webui bindings.
*
* @param {!WebView} webview Webview element to host the terms.
* @param {!string} onlineEulaUrl
* @param {boolean} clear_anchors if true the script will clear anchors
* from the loaded page.
*/
loadEulaToWebview_(webview, onlineEulaUrl, clear_anchors) {
assert(webview.tagName === 'WEBVIEW');
var loadBundledEula = function() {
WebViewHelper.loadUrlContentToWebView(
webview, TERMS_URL, WebViewHelper.ContentType.HTML);
};
// Load online Eula with a timeout to fallback to the offline version.
// This won't construct multiple EulaLoaders. Single instance.
var eulaLoader = new EulaLoader(
webview, ONLINE_EULA_LOAD_TIMEOUT_IN_MS, loadBundledEula,
clear_anchors);
eulaLoader.setUrl(onlineEulaUrl);
},
/**
* Called when focus is returned.
*/
onFocusReturned() {
$('oobe-eula-md').focus();
},
};
});
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<include src="../oobe_screen_demo_setup.html"> <include src="../oobe_screen_demo_setup.html">
<oobe-network id="network-selection" class="step hidden" hidden> <oobe-network id="network-selection" class="step hidden" hidden>
</oobe-network> </oobe-network>
<include src="../oobe_screen_eula.html"> <oobe-eula-md id="oobe-eula-md" class="step hidden" hidden></oobe-eula-md>
<oobe-update id="oobe-update" class="step hidden" hidden> <oobe-update id="oobe-update" class="step hidden" hidden>
</oobe-update> </oobe-update>
<include src="../oobe_screen_auto_enrollment_check.html"> <include src="../oobe_screen_auto_enrollment_check.html">
......
...@@ -13,9 +13,10 @@ class WebViewHelper { ...@@ -13,9 +13,10 @@ class WebViewHelper {
* The content is loaded via XHR and is sent to web view via data url so that * The content is loaded via XHR and is sent to web view via data url so that
* it is properly sandboxed. * it is properly sandboxed.
* *
* @param {!WebView} webView web view element to host the content. * @param {!Object} webView is a WebView element to host the content.
* @param {string} url URL to load the content from. * @param {string} url URL to load the content from.
* @param {!ContentType} contentType type of the content to load. * @param {!WebViewHelper.ContentType} contentType type of the content to
* load.
*/ */
static loadUrlContentToWebView(webView, url, contentType) { static loadUrlContentToWebView(webView, url, contentType) {
assert(webView.tagName === 'WEBVIEW'); assert(webView.tagName === 'WEBVIEW');
...@@ -59,7 +60,8 @@ class WebViewHelper { ...@@ -59,7 +60,8 @@ class WebViewHelper {
onError(); onError();
return; return;
} }
setContents(xhr.response); let contents = /** @type {string} */ (xhr.response);
setContents(contents);
}; };
try { try {
......
...@@ -89,8 +89,7 @@ void EulaScreenHandler::DeclareLocalizedValues( ...@@ -89,8 +89,7 @@ void EulaScreenHandler::DeclareLocalizedValues(
builder->Add("back", IDS_EULA_BACK_BUTTON); builder->Add("back", IDS_EULA_BACK_BUTTON);
builder->Add("next", IDS_EULA_NEXT_BUTTON); builder->Add("next", IDS_EULA_NEXT_BUTTON);
builder->Add("acceptAgreement", IDS_EULA_ACCEPT_AND_CONTINUE_BUTTON); builder->Add("acceptAgreement", IDS_EULA_ACCEPT_AND_CONTINUE_BUTTON);
builder->Add("eulaSystemInstallationSettings", builder->Add("eulaSystemSecuritySettings", IDS_EULA_SYSTEM_SECURITY_SETTING);
IDS_EULA_SYSTEM_SECURITY_SETTING);
builder->Add("eulaTpmDesc", IDS_EULA_SECURE_MODULE_DESCRIPTION); builder->Add("eulaTpmDesc", IDS_EULA_SECURE_MODULE_DESCRIPTION);
builder->Add("eulaTpmKeyDesc", IDS_EULA_SECURE_MODULE_KEY_DESCRIPTION); builder->Add("eulaTpmKeyDesc", IDS_EULA_SECURE_MODULE_KEY_DESCRIPTION);
...@@ -100,7 +99,7 @@ void EulaScreenHandler::DeclareLocalizedValues( ...@@ -100,7 +99,7 @@ void EulaScreenHandler::DeclareLocalizedValues(
::login::GetSecureModuleUsed(base::BindOnce( ::login::GetSecureModuleUsed(base::BindOnce(
&EulaScreenHandler::UpdateLocalizedValues, weak_factory_.GetWeakPtr())); &EulaScreenHandler::UpdateLocalizedValues, weak_factory_.GetWeakPtr()));
builder->Add("eulaSystemInstallationSettingsOkButton", IDS_OK); builder->Add("eulaSystemSecuritySettingsOkButton", IDS_OK);
builder->Add("termsOfServiceLoading", IDS_TERMS_OF_SERVICE_SCREEN_LOADING); builder->Add("termsOfServiceLoading", IDS_TERMS_OF_SERVICE_SCREEN_LOADING);
#if BUILDFLAG(ENABLE_RLZ) #if BUILDFLAG(ENABLE_RLZ)
builder->AddF("eulaRlzDesc", builder->AddF("eulaRlzDesc",
...@@ -124,14 +123,6 @@ void EulaScreenHandler::DeclareLocalizedValues( ...@@ -124,14 +123,6 @@ void EulaScreenHandler::DeclareLocalizedValues(
IDS_OOBE_EULA_ACCEPT_AND_CONTINUE_BUTTON_TEXT); IDS_OOBE_EULA_ACCEPT_AND_CONTINUE_BUTTON_TEXT);
} }
void EulaScreenHandler::DeclareJSCallbacks() {
AddCallback("eulaOnLearnMore", &EulaScreenHandler::HandleOnLearnMore);
AddCallback("eulaOnInstallationSettingsPopupOpened",
&EulaScreenHandler::HandleOnInstallationSettingsPopupOpened);
AddCallback("EulaScreen.usageStatsEnabled",
&EulaScreenHandler::HandleUsageStatsEnabled);
}
void EulaScreenHandler::GetAdditionalParameters(base::DictionaryValue* dict) { void EulaScreenHandler::GetAdditionalParameters(base::DictionaryValue* dict) {
#if BUILDFLAG(ENABLE_RLZ) #if BUILDFLAG(ENABLE_RLZ)
dict->SetString("rlzEnabled", "enabled"); dict->SetString("rlzEnabled", "enabled");
...@@ -154,23 +145,18 @@ void EulaScreenHandler::Initialize() { ...@@ -154,23 +145,18 @@ void EulaScreenHandler::Initialize() {
void EulaScreenHandler::OnPasswordFetched(const std::string& tpm_password) { void EulaScreenHandler::OnPasswordFetched(const std::string& tpm_password) {
CallJS("login.EulaScreen.setTpmPassword", tpm_password); CallJS("login.EulaScreen.setTpmPassword", tpm_password);
CallJS("login.EulaScreen.showSecuritySettingsDialog");
} }
void EulaScreenHandler::HandleOnLearnMore() { void EulaScreenHandler::ShowStatsUsageLearnMore() {
if (!help_app_.get()) if (!help_app_.get())
help_app_ = new HelpAppLauncher( help_app_ = new HelpAppLauncher(
LoginDisplayHost::default_host()->GetNativeWindow()); LoginDisplayHost::default_host()->GetNativeWindow());
help_app_->ShowHelpTopic(HelpAppLauncher::HELP_STATS_USAGE); help_app_->ShowHelpTopic(HelpAppLauncher::HELP_STATS_USAGE);
} }
void EulaScreenHandler::HandleOnInstallationSettingsPopupOpened() { void EulaScreenHandler::ShowAdditionalTosDialog() {
if (screen_) CallJS("login.EulaScreen.showAdditionalTosDialog");
screen_->InitiatePasswordFetch();
}
void EulaScreenHandler::HandleUsageStatsEnabled(bool enabled) {
if (screen_)
screen_->SetUsageStatsEnabled(enabled);
} }
void EulaScreenHandler::UpdateLocalizedValues( void EulaScreenHandler::UpdateLocalizedValues(
......
...@@ -26,7 +26,7 @@ class HelpAppLauncher; ...@@ -26,7 +26,7 @@ class HelpAppLauncher;
// dtor. // dtor.
class EulaView { class EulaView {
public: public:
constexpr static StaticOobeScreenId kScreenId{"eula"}; constexpr static StaticOobeScreenId kScreenId{"oobe-eula-md"};
virtual ~EulaView() {} virtual ~EulaView() {}
...@@ -35,6 +35,8 @@ class EulaView { ...@@ -35,6 +35,8 @@ class EulaView {
virtual void Bind(EulaScreen* screen) = 0; virtual void Bind(EulaScreen* screen) = 0;
virtual void Unbind() = 0; virtual void Unbind() = 0;
virtual void OnPasswordFetched(const std::string& tpm_password) = 0; virtual void OnPasswordFetched(const std::string& tpm_password) = 0;
virtual void ShowStatsUsageLearnMore() = 0;
virtual void ShowAdditionalTosDialog() = 0;
}; };
// WebUI implementation of EulaScreenView. It is used to interact // WebUI implementation of EulaScreenView. It is used to interact
...@@ -53,20 +55,16 @@ class EulaScreenHandler : public EulaView, public BaseScreenHandler { ...@@ -53,20 +55,16 @@ class EulaScreenHandler : public EulaView, public BaseScreenHandler {
void Bind(EulaScreen* screen) override; void Bind(EulaScreen* screen) override;
void Unbind() override; void Unbind() override;
void OnPasswordFetched(const std::string& tpm_password) override; void OnPasswordFetched(const std::string& tpm_password) override;
void ShowStatsUsageLearnMore() override;
void ShowAdditionalTosDialog() override;
// BaseScreenHandler implementation: // BaseScreenHandler implementation:
void DeclareLocalizedValues( void DeclareLocalizedValues(
::login::LocalizedValuesBuilder* builder) override; ::login::LocalizedValuesBuilder* builder) override;
void DeclareJSCallbacks() override;
void GetAdditionalParameters(base::DictionaryValue* dict) override; void GetAdditionalParameters(base::DictionaryValue* dict) override;
void Initialize() override; void Initialize() override;
private: private:
// JS messages handlers.
void HandleOnLearnMore();
void HandleOnInstallationSettingsPopupOpened();
void HandleUsageStatsEnabled(bool enabled);
// Determines the online URL to use. // Determines the online URL to use.
std::string GetEulaOnlineUrl(); std::string GetEulaOnlineUrl();
std::string GetAdditionalToSUrl(); std::string GetAdditionalToSUrl();
...@@ -76,12 +74,12 @@ class EulaScreenHandler : public EulaView, public BaseScreenHandler { ...@@ -76,12 +74,12 @@ class EulaScreenHandler : public EulaView, public BaseScreenHandler {
EulaScreen* screen_ = nullptr; EulaScreen* screen_ = nullptr;
CoreOobeView* core_oobe_view_ = nullptr; CoreOobeView* core_oobe_view_ = nullptr;
// Help application used for help dialogs.
scoped_refptr<HelpAppLauncher> help_app_;
// Keeps whether screen should be shown right after initialization. // Keeps whether screen should be shown right after initialization.
bool show_on_init_ = false; bool show_on_init_ = false;
// Help application used for help dialogs.
scoped_refptr<HelpAppLauncher> help_app_;
base::WeakPtrFactory<EulaScreenHandler> weak_factory_{this}; base::WeakPtrFactory<EulaScreenHandler> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(EulaScreenHandler); DISALLOW_COPY_AND_ASSIGN(EulaScreenHandler);
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
/** @const */ var SCREEN_WELCOME = 'connect'; /** @const */ var SCREEN_WELCOME = 'connect';
/** @const */ var SCREEN_OOBE_NETWORK = 'network-selection'; /** @const */ var SCREEN_OOBE_NETWORK = 'network-selection';
/** @const */ var SCREEN_OOBE_HID_DETECTION = 'hid-detection'; /** @const */ var SCREEN_OOBE_HID_DETECTION = 'hid-detection';
/** @const */ var SCREEN_OOBE_EULA = 'eula';
/** @const */ var SCREEN_OOBE_ENABLE_DEBUGGING = 'debugging'; /** @const */ var SCREEN_OOBE_ENABLE_DEBUGGING = 'debugging';
/** @const */ var SCREEN_OOBE_UPDATE = 'oobe-update'; /** @const */ var SCREEN_OOBE_UPDATE = 'oobe-update';
/** @const */ var SCREEN_OOBE_RESET = 'reset'; /** @const */ var SCREEN_OOBE_RESET = 'reset';
...@@ -94,7 +93,6 @@ cr.define('cr.ui.login', function() { ...@@ -94,7 +93,6 @@ cr.define('cr.ui.login', function() {
*/ */
var RESET_AVAILABLE_SCREEN_GROUP = [ var RESET_AVAILABLE_SCREEN_GROUP = [
SCREEN_OOBE_NETWORK, SCREEN_OOBE_NETWORK,
SCREEN_OOBE_EULA,
SCREEN_OOBE_AUTO_ENROLLMENT_CHECK, SCREEN_OOBE_AUTO_ENROLLMENT_CHECK,
SCREEN_GAIA_SIGNIN, SCREEN_GAIA_SIGNIN,
SCREEN_ACCOUNT_PICKER, SCREEN_ACCOUNT_PICKER,
......
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