Commit 939293aa authored by Mattias Nissler's avatar Mattias Nissler Committed by Commit Bot

Add learn more link to TPM firmware update option

This adds a learn more link to the TPM firmware update option on the device
reset aka powerwash OOBE screen.

BUG=chromium:767900
TEST=Manual

Change-Id: Iaaeb7c63f877b0b0d6e8e5fb3073a04eec3bd3e8
Reviewed-on: https://chromium-review.googlesource.com/682694Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Mattias Nissler <mnissler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504206}
parent 6573f474
......@@ -35,6 +35,8 @@ class HelpAppLauncher : public base::RefCountedThreadSafe<HelpAppLauncher> {
HELP_POWERWASH = 183084,
// Shown as "Learn more" about the device attributes.
HELP_DEVICE_ATTRIBUTES = 6218780,
// Shown as "Learn more" for TPM firmware udpate option in reset screen.
HELP_TPM_FIRMWARE_UPDATE = 7507584,
};
// The dialog is shown as a child of |parent_window|. If |parent_window| is
......
......@@ -37,6 +37,8 @@ constexpr const char kUserActionResetShowConfirmationPressed[] =
"show-confirmation";
constexpr const char kUserActionResetResetConfirmationDismissed[] =
"reset-confirm-dismissed";
constexpr const char kUserActionTPMFirmwareUpdateLearnMore[] =
"tpm-firmware-update-learn-more-link";
constexpr const char kContextKeyIsRollbackAvailable[] = "rollback-available";
constexpr const char kContextKeyIsRollbackChecked[] = "rollback-checked";
......@@ -159,13 +161,15 @@ void ResetScreen::OnUserAction(const std::string& action_id) {
else if (action_id == kUserActionResetPowerwashPressed)
OnPowerwash();
else if (action_id == kUserActionResetLearnMorePressed)
OnLearnMore();
ShowHelpArticle(HelpAppLauncher::HELP_POWERWASH);
else if (action_id == kUserActionResetRollbackToggled)
OnToggleRollback();
else if (action_id == kUserActionResetShowConfirmationPressed)
OnShowConfirm();
else if (action_id == kUserActionResetResetConfirmationDismissed)
OnConfirmationDismissed();
else if (action_id == kUserActionTPMFirmwareUpdateLearnMore)
ShowHelpArticle(HelpAppLauncher::HELP_TPM_FIRMWARE_UPDATE);
else
BaseScreen::OnUserAction(action_id);
}
......@@ -257,21 +261,21 @@ void ResetScreen::OnShowConfirm() {
GetContextEditor().SetBoolean(kContextKeyIsConfirmational, true);
}
void ResetScreen::OnLearnMore() {
void ResetScreen::OnConfirmationDismissed() {
GetContextEditor().SetBoolean(kContextKeyIsConfirmational, false);
}
void ResetScreen::ShowHelpArticle(HelpAppLauncher::HelpTopic topic) {
#if defined(OFFICIAL_BUILD)
VLOG(1) << "Trying to view the help article about reset options.";
VLOG(1) << "Trying to view help article " << topic;
if (!help_app_.get()) {
help_app_ = new HelpAppLauncher(
LoginDisplayHost::default_host()->GetNativeWindow());
}
help_app_->ShowHelpTopic(HelpAppLauncher::HELP_POWERWASH);
help_app_->ShowHelpTopic(topic);
#endif
}
void ResetScreen::OnConfirmationDismissed() {
GetContextEditor().SetBoolean(kContextKeyIsConfirmational, false);
}
void ResetScreen::UpdateStatusChanged(
const UpdateEngineClient::Status& status) {
VLOG(1) << "Update status change to " << status.status;
......
......@@ -59,9 +59,10 @@ class ResetScreen : public BaseScreen, public UpdateEngineClient::Observer {
void OnRestart();
void OnToggleRollback();
void OnShowConfirm();
void OnLearnMore();
void OnConfirmationDismissed();
void ShowHelpArticle(HelpAppLauncher::HelpTopic topic);
// Returns an instance of the error screen.
ErrorScreen* GetErrorScreen();
......
......@@ -45,3 +45,8 @@ a {
-webkit-margin-start: 16px;
line-height: 20px;
}
#tpmFirmwareUpdateContainer a {
cursor: pointer;
pointer-events: auto;
}
......@@ -74,6 +74,9 @@
on-change="onTPMFirmwareUpdateChanged_">
<div id="tpmFirmwareUpdateContainer">
<span i18n-content="resetTPMFirmwareUpdate"></span>
<a href="#" hidden="[[isHelpLinkHidden_(uiState_, isOfficial_)]]"
on-tap="onTPMFirmwareUpdateLearnMore_"
i18n-content="learnMore"></a>
</div>
</paper-checkbox>
</div>
......
......@@ -113,4 +113,17 @@ Polymer({
this.screen.onTPMFirmwareUpdateChanged_(
this.$.tpmFirmwareUpdateCheckbox.checked);
},
/**
* On-tap event handler for the TPM firmware update learn more link.
*
* @param {!Event} event
* @private
*/
onTPMFirmwareUpdateLearnMore_: function(event) {
chrome.send(
'login.ResetScreen.userActed', ['tpm-firmware-update-learn-more-link']);
event.stopPropagation();
},
});
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