Commit ff3c2756 authored by Daniel Hosseinian's avatar Daniel Hosseinian Committed by Commit Bot

Add Cloud Print deprecation warning under destination select

Add a deprecation warning message for Cloud and Privet printers under
the destination select.

Note: This change is only for non-CrOS desktop. CrOS changes will be
applied in a chained CL.

Screenshot of change: https://imgur.com/cZqYwba

Bug: 1112581
Change-Id: I2057cab0daa8d6f169ae6255172970a84b2803f0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2353731
Commit-Queue: Daniel Hosseinian <dhoss@chromium.org>
Reviewed-by: default avatarRebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799487}
parent a408603c
......@@ -410,7 +410,7 @@
<!-- Cloud Print deprecation strings -->
<if expr="not is_android">
<message name="IDS_PRINTER_NOT_SUPPORTED_WARNING" desc="Warning shown to the user to inform them that a particular printer will no longer be supported.">
This printer won't be supported after December. <ph name="BEGIN_LINK_LEARN_MORE">&lt;a is="action-link" href="" target="_blank"&gt;</ph>Learn more<ph name="END_LINK_LEARN_MORE">&lt;/a&gt;</ph>
This printer won't be supported after December. <ph name="BEGIN_LINK_LEARN_MORE">&lt;a href="$1<ex>https://google.com/</ex>" target="_blank"&gt;</ph>Learn more<ph name="END_LINK_LEARN_MORE">&lt;/a&gt;</ph>
</message>
<message name="IDS_PRINTER_NOT_SUPPORTED_WARNING_ENTERPRISE" desc="Warning shown to users managed by enterprise policy to inform them that a particular printer will no longer be supported.">
This printer won't be supported after December. Contact your admin.
......
542bb8855af9b56817754882da5eaf50b35d23bd
\ No newline at end of file
48b67b82a72a80cc632cdad7813ff3f3b90e1cee
\ No newline at end of file
......@@ -171,7 +171,16 @@ Polymer({
return this.i18nAdvanced('saveToDriveNotSupportedWarning');
}
// Give preference to connection status.
if (this.destination.connectionStatusText) {
return this.destination.connectionStatusText;
}
if (this.destination.shouldShowDeprecatedPrinterWarning) {
return this.i18nAdvanced('printerNotSupportedWarning');
}
return '';
},
/** @private */
......
......@@ -350,8 +350,20 @@ void AddPrintPreviewStrings(content::WebUIDataSource* source) {
source->AddString("gcpCertificateErrorLearnMoreURL",
chrome::kCloudPrintCertificateErrorLearnMoreURL);
const bool is_enterprise_managed = webui::IsEnterpriseManaged();
if (is_enterprise_managed) {
source->AddLocalizedString("printerNotSupportedWarning",
IDS_PRINTER_NOT_SUPPORTED_WARNING_ENTERPRISE);
} else {
source->AddString(
"printerNotSupportedWarning",
l10n_util::GetStringFUTF16(
IDS_PRINTER_NOT_SUPPORTED_WARNING,
base::ASCIIToUTF16(cloud_devices::kCloudPrintDeprecationHelpURL)));
}
#if !defined(OS_CHROMEOS)
if (webui::IsEnterpriseManaged()) {
if (is_enterprise_managed) {
source->AddLocalizedString(
"saveToDriveNotSupportedWarning",
IDS_GOOGLE_DRIVE_OPTION_NOT_SUPPORTED_WARNING_ENTERPRISE);
......
......@@ -141,6 +141,10 @@ suite(destination_select_test.suiteName, function() {
'printer-not-supported';
compareIcon(selectEl, dest3Icon);
// Update destination.
destinationSelect.destination = recentDestinationList[2];
compareIcon(selectEl, dest3Icon);
});
}
......@@ -153,6 +157,7 @@ suite(destination_select_test.suiteName, function() {
function testUpdateStatus(cloudPrintDeprecationWarningsSuppressed) {
loadTimeData.overrideValues({
offline: 'offline',
printerNotSupportedWarning: 'printerNotSupportedWarning',
saveToDriveNotSupportedWarning: 'saveToDriveNotSupportedWarning',
});
......@@ -189,8 +194,12 @@ suite(destination_select_test.suiteName, function() {
destinationSelect.destination = recentDestinationList[2];
destinationSelect.updateDestination();
assertTrue(additionalInfoEl.hidden);
assertEquals('', statusEl.innerHTML);
assertEquals(
cloudPrintDeprecationWarningsSuppressed, additionalInfoEl.hidden);
const dest3Status = cloudPrintDeprecationWarningsSuppressed ?
'' :
'printerNotSupportedWarning';
assertEquals(dest3Status, statusEl.innerHTML);
}
test(assert(destination_select_test.TestNames.UpdateStatus), function() {
......
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