Commit ebeaa196 authored by Mattias Nissler's avatar Mattias Nissler Committed by Commit Bot

Revert "Add TPM firmware update option to about page."

This reverts commit 2ade99c3.

Reason for revert: Breaks compile on Closure_Compilation_Linux, see https://luci-logdog.appspot.com/v/?s=chromium%2Fbb%2Fchromium.fyi%2FClosure_Compilation_Linux%2F120458%2F%2B%2Frecipes%2Fsteps%2Fcompile%2F0%2Fstdout

Original change's description:
> Add TPM firmware update option to about page.
> 
> BUG=chromium:742985
> TEST=New webui test case in CrSettingsAboutPageTest.AboutPage
> 
> Change-Id: Ie5d5d4f61efb56aa8fe61988bfdbdc44450a34b7
> Reviewed-on: https://chromium-review.googlesource.com/678728
> Commit-Queue: Mattias Nissler <mnissler@chromium.org>
> Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
> Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#504315}

TBR=xiyuan@chromium.org,stevenjb@chromium.org,mnissler@chromium.org

Change-Id: I974a2ff1b144fc912444d41d98c6421270f81987
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:742985
Reviewed-on: https://chromium-review.googlesource.com/684374Reviewed-by: default avatarMattias Nissler <mnissler@chromium.org>
Commit-Queue: Mattias Nissler <mnissler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504318}
parent 4154f943
...@@ -57,12 +57,6 @@ ...@@ -57,12 +57,6 @@
<message name="IDS_SETTINGS_ABOUT_PAGE_RELAUNCH_AND_POWERWASH" desc="The label for the button that relaunches and powerwashes the browser once update is complete"> <message name="IDS_SETTINGS_ABOUT_PAGE_RELAUNCH_AND_POWERWASH" desc="The label for the button that relaunches and powerwashes the browser once update is complete">
Relaunch and Powerwash Relaunch and Powerwash
</message> </message>
<message name="IDS_SETTINGS_ABOUT_TPM_FIRMWARE_UPDATE_TITLE" desc="Title for the line item on the about page that allows the user to trigger a device hardware reset and request installation of a TPM firmware update.">
Powerwash for added security
</message>
<message name="IDS_SETTINGS_ABOUT_TPM_FIRMWARE_UPDATE_DESCRIPTION" desc="Descriptive text shown alongside the line item on the about page that allows the user to trigger a device hardware reset and request installation of a TPM firmware update.">
This upgrade resets your Chromebook and removes current user data.
</message>
<message name="IDS_SETTINGS_UPGRADE_UPDATING" desc="Status label: Updating ChromiumOS or ChromeOS"> <message name="IDS_SETTINGS_UPGRADE_UPDATING" desc="Status label: Updating ChromiumOS or ChromeOS">
Updating your device Updating your device
</message> </message>
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
<link rel="import" href="detailed_build_info.html"> <link rel="import" href="detailed_build_info.html">
<link rel="import" href="update_warning_dialog.html"> <link rel="import" href="update_warning_dialog.html">
<link rel="import" href="../settings_page/settings_subpage.html"> <link rel="import" href="../settings_page/settings_subpage.html">
<link rel="import" href="../reset_page/powerwash_dialog.html">
</if> </if>
<if expr="_google_chrome and is_macosx"> <if expr="_google_chrome and is_macosx">
...@@ -143,25 +142,6 @@ ...@@ -143,25 +142,6 @@
</if> </if>
</span> </span>
</div> </div>
<if expr="chromeos">
<div id="aboutTPMFirmwareUpdate" class="settings-box two-line"
hidden$="[[!showTPMFirmwareUpdateLineItem_]]"
on-tap="onTPMFirmwareUpdateTap_" actionable>
<div class="start">
<div>$i18n{aboutTPMFirmwareUpdateTitle}</div>
<div class="secondary">
$i18n{aboutTPMFirmwareUpdateDescription}
<a href="$i18n{aboutTPMFirmwareUpdateLearnMoreURL}"
target="_blank" on-tap="onLearnMoreTap_">
$i18n{learnMore}
</a>
</div>
</div>
<button class="subpage-arrow" is="paper-icon-button-light"
aria-labelledby="aboutTPMFirmwareUpdate">
</button>
</div>
</if>
<if expr="_google_chrome and is_macosx"> <if expr="_google_chrome and is_macosx">
<template is="dom-if" if="[[!promoteUpdaterStatus_.hidden]]"> <template is="dom-if" if="[[!promoteUpdaterStatus_.hidden]]">
<div id="promoteUpdater" class="settings-box" <div id="promoteUpdater" class="settings-box"
...@@ -249,12 +229,6 @@ ...@@ -249,12 +229,6 @@
on-close="onUpdateWarningDialogClose_"> on-close="onUpdateWarningDialogClose_">
</settings-update-warning-dialog> </settings-update-warning-dialog>
</template> </template>
<template is="dom-if" if="[[showTPMFirmwareUpdateDialog_]]"
restamp>
<settings-powerwash-dialog request-tpm-firmware-update
on-close="onPowerwashDialogClose_">
</settings-powerwash-dialog>
</template>
</if> </if>
</template> </template>
<script src="about_page.js"></script> <script src="about_page.js"></script>
......
...@@ -96,12 +96,6 @@ Polymer({ ...@@ -96,12 +96,6 @@ Polymer({
value: false, value: false,
}, },
/** @private */
showTPMFirmwareUpdateLineItem_: Boolean,
/** @private */
showTPMFirmwareUpdateDialog_: Boolean,
/** @private {!AboutPageUpdateInfo|undefined} */ /** @private {!AboutPageUpdateInfo|undefined} */
updateInfo_: Object, updateInfo_: Object,
// </if> // </if>
...@@ -174,12 +168,6 @@ Polymer({ ...@@ -174,12 +168,6 @@ Polymer({
this.onPromoteUpdaterStatusChanged_.bind(this)); this.onPromoteUpdaterStatusChanged_.bind(this));
// </if> // </if>
this.aboutBrowserProxy_.refreshUpdateStatus(); this.aboutBrowserProxy_.refreshUpdateStatus();
// <if expr="chromeos">
this.addWebUIListener(
'tpm-firmware-update-status-changed',
this.onTPMFirmwareUpdateStatusChanged_.bind(this));
this.aboutBrowserProxy_.refreshTPMFirmwareUpdateStatus();
// </if>
}, },
/** /**
...@@ -218,7 +206,6 @@ Polymer({ ...@@ -218,7 +206,6 @@ Polymer({
return; return;
this.aboutBrowserProxy_.promoteUpdater(); this.aboutBrowserProxy_.promoteUpdater();
}, },
// </if>
/** /**
* @param {!Event} event * @param {!Event} event
...@@ -229,6 +216,7 @@ Polymer({ ...@@ -229,6 +216,7 @@ Polymer({
// actionable items won't trigger action. // actionable items won't trigger action.
event.stopPropagation(); event.stopPropagation();
}, },
// </if>
/** @private */ /** @private */
onHelpTap_: function() { onHelpTap_: function() {
...@@ -455,24 +443,6 @@ Polymer({ ...@@ -455,24 +443,6 @@ Polymer({
// dialog and then intends to check for update again. // dialog and then intends to check for update again.
this.hasCheckedForUpdates_ = false; this.hasCheckedForUpdates_ = false;
}, },
/**
* @param {!TPMFirmwareUpdateStatusChangedEvent} event
* @private
*/
onTPMFirmwareUpdateStatusChanged_: function(event) {
this.showTPMFirmwareUpdateLineItem_ = event.updateAvailable;
},
/** @private */
onTPMFirmwareUpdateTap_: function() {
this.showTPMFirmwareUpdateDialog_ = true;
},
/** @private */
onPowerwashDialogClose_: function() {
this.showTPMFirmwareUpdateDialog_ = false;
},
// </if> // </if>
/** @private */ /** @private */
......
...@@ -190,11 +190,6 @@ cr.define('settings', function() { ...@@ -190,11 +190,6 @@ cr.define('settings', function() {
/** @return {!Promise<?RegulatoryInfo>} */ /** @return {!Promise<?RegulatoryInfo>} */
getRegulatoryInfo() {} getRegulatoryInfo() {}
/**
* Request TPM firmware update status from the browser. It results in one or
* more 'tpm-firmware-update-status-changed' WebUI events.
*/
refreshTPMFirmwareUpdateStatus() {}
// </if> // </if>
// <if expr="_google_chrome and is_macosx"> // <if expr="_google_chrome and is_macosx">
...@@ -270,11 +265,6 @@ cr.define('settings', function() { ...@@ -270,11 +265,6 @@ cr.define('settings', function() {
getRegulatoryInfo() { getRegulatoryInfo() {
return cr.sendWithPromise('getRegulatoryInfo'); return cr.sendWithPromise('getRegulatoryInfo');
} }
/** @override */
refreshTPMFirmwareUpdateStatus() {
chrome.send('refreshTPMFirmwareUpdateStatus');
}
// </if> // </if>
} }
......
...@@ -15,13 +15,8 @@ cr.define('settings', function() { ...@@ -15,13 +15,8 @@ cr.define('settings', function() {
// First signs out current user and then performs a restart. // First signs out current user and then performs a restart.
signOutAndRestart() {} signOutAndRestart() {}
/** // Triggers a factory reset.
* Triggers a factory reset. The parameter indicates whether to install a factoryReset() {}
* TPM firmware update (if available) after the reset.
*
* @param {boolean} requestTpmFirmwareUpdate
*/
factoryReset(requestTpmFirmwareUpdate) {}
// </if> // </if>
} }
...@@ -46,8 +41,8 @@ cr.define('settings', function() { ...@@ -46,8 +41,8 @@ cr.define('settings', function() {
} }
/** @override */ /** @override */
factoryReset(requestTpmFirmwareUpdate) { factoryReset() {
chrome.send('factoryReset', [requestTpmFirmwareUpdate]); chrome.send('factoryReset');
} }
// </if> // </if>
} }
......
...@@ -4,17 +4,12 @@ ...@@ -4,17 +4,12 @@
/** /**
* @fileoverview * @fileoverview
* 'settings-powerwash-dialog' is a dialog shown to request confirmation from * 'settings-reset-page' is the settings page containing reset
* the user for a device reset (aka powerwash). * settings.
*/ */
Polymer({ Polymer({
is: 'settings-powerwash-dialog', is: 'settings-powerwash-dialog',
properties: {
/** @public */
requestTpmFirmwareUpdate: Boolean,
},
/** @override */ /** @override */
attached: function() { attached: function() {
settings.ResetBrowserProxyImpl.getInstance().onPowerwashDialogShow(); settings.ResetBrowserProxyImpl.getInstance().onPowerwashDialogShow();
...@@ -28,7 +23,6 @@ Polymer({ ...@@ -28,7 +23,6 @@ Polymer({
/** @private */ /** @private */
onRestartTap_: function() { onRestartTap_: function() {
settings.LifetimeBrowserProxyImpl.getInstance().factoryReset( settings.LifetimeBrowserProxyImpl.getInstance().factoryReset();
this.requestTpmFirmwareUpdate);
}, },
}); });
...@@ -61,7 +61,6 @@ ...@@ -61,7 +61,6 @@
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h" #include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/chromeos/settings/cros_settings.h" #include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/chromeos/tpm_firmware_update.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/chromeos/image_source.h" #include "chrome/browser/ui/webui/chromeos/image_source.h"
#include "chrome/browser/ui/webui/help/help_utils_chromeos.h" #include "chrome/browser/ui/webui/help/help_utils_chromeos.h"
...@@ -375,10 +374,6 @@ void AboutHandler::RegisterMessages() { ...@@ -375,10 +374,6 @@ void AboutHandler::RegisterMessages() {
web_ui()->RegisterMessageCallback( web_ui()->RegisterMessageCallback(
"getChannelInfo", base::Bind(&AboutHandler::HandleGetChannelInfo, "getChannelInfo", base::Bind(&AboutHandler::HandleGetChannelInfo,
base::Unretained(this))); base::Unretained(this)));
web_ui()->RegisterMessageCallback(
"refreshTPMFirmwareUpdateStatus",
base::Bind(&AboutHandler::HandleRefreshTPMFirmwareUpdateStatus,
base::Unretained(this)));
#endif #endif
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
web_ui()->RegisterMessageCallback( web_ui()->RegisterMessageCallback(
...@@ -591,18 +586,6 @@ void AboutHandler::RequestUpdateOverCellular(const std::string& update_version, ...@@ -591,18 +586,6 @@ void AboutHandler::RequestUpdateOverCellular(const std::string& update_version,
update_version, update_size); update_version, update_size);
} }
void AboutHandler::HandleRefreshTPMFirmwareUpdateStatus(
const base::ListValue* args) {
chromeos::tpm_firmware_update::ShouldOfferUpdateViaPowerwash(
base::Bind(&AboutHandler::RefreshTPMFirmwareUpdateStatus,
weak_factory_.GetWeakPtr()));
}
void AboutHandler::RefreshTPMFirmwareUpdateStatus(bool update_available) {
std::unique_ptr<base::DictionaryValue> event(new base::DictionaryValue);
event->SetBoolean("updateAvailable", update_available);
FireWebUIListener("tpm-firmware-update-status-changed", *event);
}
#endif // defined(OS_CHROMEOS) #endif // defined(OS_CHROMEOS)
void AboutHandler::RequestUpdate() { void AboutHandler::RequestUpdate() {
......
...@@ -114,10 +114,6 @@ class AboutHandler : public settings::SettingsPageUIHandler, ...@@ -114,10 +114,6 @@ class AboutHandler : public settings::SettingsPageUIHandler,
void RequestUpdateOverCellular(const std::string& update_version, void RequestUpdateOverCellular(const std::string& update_version,
int64_t update_size); int64_t update_size);
// Called once when the page has loaded to retrieve the TPM firmware update
// status.
void HandleRefreshTPMFirmwareUpdateStatus(const base::ListValue* args);
void RefreshTPMFirmwareUpdateStatus(bool update_available);
#endif #endif
// Checks for and applies update. // Checks for and applies update.
......
...@@ -258,10 +258,6 @@ void AddAboutStrings(content::WebUIDataSource* html_source) { ...@@ -258,10 +258,6 @@ void AddAboutStrings(content::WebUIDataSource* html_source) {
{"aboutUpgradeSuccessChannelSwitch", {"aboutUpgradeSuccessChannelSwitch",
IDS_SETTINGS_UPGRADE_SUCCESSFUL_CHANNEL_SWITCH}, IDS_SETTINGS_UPGRADE_SUCCESSFUL_CHANNEL_SWITCH},
{"aboutUserAgentLabel", IDS_VERSION_UI_USER_AGENT}, {"aboutUserAgentLabel", IDS_VERSION_UI_USER_AGENT},
{"aboutTPMFirmwareUpdateTitle",
IDS_SETTINGS_ABOUT_TPM_FIRMWARE_UPDATE_TITLE},
{"aboutTPMFirmwareUpdateDescription",
IDS_SETTINGS_ABOUT_TPM_FIRMWARE_UPDATE_DESCRIPTION},
// About page, channel switcher dialog. // About page, channel switcher dialog.
{"aboutChangeChannel", IDS_SETTINGS_ABOUT_PAGE_CHANGE_CHANNEL}, {"aboutChangeChannel", IDS_SETTINGS_ABOUT_PAGE_CHANGE_CHANNEL},
...@@ -300,11 +296,6 @@ void AddAboutStrings(content::WebUIDataSource* html_source) { ...@@ -300,11 +296,6 @@ void AddAboutStrings(content::WebUIDataSource* html_source) {
#else #else
l10n_util::GetStringUTF16(IDS_SETTINGS_UPGRADE_UP_TO_DATE)); l10n_util::GetStringUTF16(IDS_SETTINGS_UPGRADE_UP_TO_DATE));
#endif #endif
#if defined(OS_CHROMEOS)
html_source->AddString("aboutTPMFirmwareUpdateLearnMoreURL",
chrome::kTPMFirmwareUpdateLearnMoreURL);
#endif
} }
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
......
...@@ -626,8 +626,6 @@ const char kAndroidAppsLearnMoreURL[] = ...@@ -626,8 +626,6 @@ const char kAndroidAppsLearnMoreURL[] =
"https://support.google.com/chromebook/?p=playapps"; "https://support.google.com/chromebook/?p=playapps";
const char kInstantTetheringLearnMoreURL[] = const char kInstantTetheringLearnMoreURL[] =
"https://support.google.com/chromebook?p=instant_tethering"; "https://support.google.com/chromebook?p=instant_tethering";
const char kTPMFirmwareUpdateLearnMoreURL[] =
"https://support.google.com/chromebook/?p=tpm_update";
#endif #endif
const char kRemoveNonCWSExtensionURL[] = const char kRemoveNonCWSExtensionURL[] =
......
...@@ -522,9 +522,6 @@ extern const char kAndroidAppsLearnMoreURL[]; ...@@ -522,9 +522,6 @@ extern const char kAndroidAppsLearnMoreURL[];
// The URL for the "learn more" link for Instant Tethering. // The URL for the "learn more" link for Instant Tethering.
extern const char kInstantTetheringLearnMoreURL[]; extern const char kInstantTetheringLearnMoreURL[];
// The URL for the "learn more" link for TPM firmware update.
extern const char kTPMFirmwareUpdateLearnMoreURL[];
#endif #endif
// The URL for the Learn More link of the non-CWS bubble. // The URL for the Learn More link of the non-CWS bubble.
......
...@@ -18,7 +18,6 @@ cr.define('settings_about_page', function() { ...@@ -18,7 +18,6 @@ cr.define('settings_about_page', function() {
'getChannelInfo', 'getChannelInfo',
'getVersionInfo', 'getVersionInfo',
'getRegulatoryInfo', 'getRegulatoryInfo',
'refreshTPMFirmwareUpdateStatus',
'setChannel'); 'setChannel');
} }
...@@ -47,11 +46,6 @@ cr.define('settings_about_page', function() { ...@@ -47,11 +46,6 @@ cr.define('settings_about_page', function() {
/** @private {?RegulatoryInfo} */ /** @private {?RegulatoryInfo} */
this.regulatoryInfo_ = null; this.regulatoryInfo_ = null;
/** @private {!TPMFirmwareUpdateStatus} */
this.tpmFirmwareUpdateStatus_ = {
updateAvailable: false,
};
} }
} }
...@@ -152,20 +146,6 @@ cr.define('settings_about_page', function() { ...@@ -152,20 +146,6 @@ cr.define('settings_about_page', function() {
channel, isPowerwashAllowed) { channel, isPowerwashAllowed) {
this.methodCalled('setChannel', [channel, isPowerwashAllowed]); this.methodCalled('setChannel', [channel, isPowerwashAllowed]);
}; };
/** @param {!TPMFirmwareUpdateStatus} status */
TestAboutPageBrowserProxy.prototype.setTPMFirmwareUpdateStatus = function(
status) {
this.tpmFirmwareUpdateStatus_ = status;
};
/** @override */
TestAboutPageBrowserProxy.prototype.refreshTPMFirmwareUpdateStatus =
function() {
this.methodCalled('refreshTPMFirmwareUpdateStatus');
cr.webUIListenerCallback(
'tpm-firmware-update-status-changed', this.tpmFirmwareUpdateStatus_);
};
} }
...@@ -229,7 +209,6 @@ cr.define('settings_about_page', function() { ...@@ -229,7 +209,6 @@ cr.define('settings_about_page', function() {
return Promise.all([ return Promise.all([
aboutBrowserProxy.whenCalled('getChannelInfo'), aboutBrowserProxy.whenCalled('getChannelInfo'),
aboutBrowserProxy.whenCalled('refreshUpdateStatus'), aboutBrowserProxy.whenCalled('refreshUpdateStatus'),
aboutBrowserProxy.whenCalled('refreshTPMFirmwareUpdateStatus'),
]); ]);
} }
} }
...@@ -564,27 +543,6 @@ cr.define('settings_about_page', function() { ...@@ -564,27 +543,6 @@ cr.define('settings_about_page', function() {
return checkRegulatoryInfo(true); return checkRegulatoryInfo(true);
}); });
}); });
test('TPMFirmwareUpdate', function() {
return initNewPage().then(function() {
assertTrue(page.$.aboutTPMFirmwareUpdate.hidden);
aboutBrowserProxy.setTPMFirmwareUpdateStatus(
{updateAvailable: true});
aboutBrowserProxy.refreshTPMFirmwareUpdateStatus();
}).then(function() {
assertFalse(page.$.aboutTPMFirmwareUpdate.hidden);
MockInteractions.tap(page.$.aboutTPMFirmwareUpdate);
}).then(function() {
var dialog = page.$$('settings-powerwash-dialog');
assertTrue(!!dialog);
assertTrue(dialog.$.dialog.open);
MockInteractions.tap(dialog.$$('#powerwash'));
return lifetimeBrowserProxy.whenCalled('factoryReset')
.then(function(requestTpmFirmwareUpdate) {
assertTrue(requestTpmFirmwareUpdate);
});
});
});
} }
if (!cr.isChromeOS) { if (!cr.isChromeOS) {
......
...@@ -35,9 +35,8 @@ cr.define('settings', function() { ...@@ -35,9 +35,8 @@ cr.define('settings', function() {
}; };
/** @override */ /** @override */
TestLifetimeBrowserProxy.prototype.factoryReset = function( TestLifetimeBrowserProxy.prototype.factoryReset = function() {
requestTpmFirmwareUpdate) { this.methodCalled('factoryReset');
this.methodCalled('factoryReset', requestTpmFirmwareUpdate);
}; };
} }
......
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