Commit 3eb584cf authored by Daniel Hosseinian's avatar Daniel Hosseinian Committed by Commit Bot

Revert "Add "Save to Drive" deprecation warning under destination select"

This reverts commit fd6ef652.

Reason for revert: This change broke linux-lacros-tester-rel

Original change's description:
> Add "Save to Drive" deprecation warning under destination select
> 
> Add a deprecation warning message for the "Save to Drive" destination
> under the destination select.
> 
> Screenshot of change: https://imgur.com/ix1GjIB
> 
> Bug: 1112581
> Change-Id: Icecc4e90e97f0e4faae0ceca32e19fe10a5de51f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2353555
> Commit-Queue: Daniel Hosseinian <dhoss@chromium.org>
> Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#799230}

TBR=rbpotter@chromium.org,dhoss@chromium.org

Change-Id: I67e541e2ec150dcac2b2de8a075b506201f35c58
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1112581
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2363700Reviewed-by: default avatarDaniel Hosseinian <dhoss@chromium.org>
Commit-Queue: Daniel Hosseinian <dhoss@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799333}
parent 049e99d0
...@@ -420,7 +420,7 @@ ...@@ -420,7 +420,7 @@
</message> </message>
<if expr="not chromeos"> <if expr="not chromeos">
<message name="IDS_GOOGLE_DRIVE_OPTION_NOT_SUPPORTED_WARNING" desc="Warning shown to the user to inform them that saving to Google Drive will no longer be supported."> <message name="IDS_GOOGLE_DRIVE_OPTION_NOT_SUPPORTED_WARNING" desc="Warning shown to the user to inform them that saving to Google Drive will no longer be supported.">
This option 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> This option 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>
</message> </message>
<message name="IDS_GOOGLE_DRIVE_OPTION_NOT_SUPPORTED_WARNING_ENTERPRISE" desc="Warning shown to users managed by enterprise policy to inform them that saving to Google Drive will no longer be supported."> <message name="IDS_GOOGLE_DRIVE_OPTION_NOT_SUPPORTED_WARNING_ENTERPRISE" desc="Warning shown to users managed by enterprise policy to inform them that saving to Google Drive will no longer be supported.">
This option won't be supported after December. Contact your admin. This option won't be supported after December. Contact your admin.
......
d98b8cce548526f85193cee9910d8f77365ce813 063af411afd178ac9c505958807cc8429624ed70
\ No newline at end of file \ No newline at end of file
<style include="print-preview-shared throbber md-select destination-select <style include="print-preview-shared throbber md-select destination-select cr-hidden-style">
cr-hidden-style">
</style> </style>
<print-preview-settings-section> <print-preview-settings-section>
<span slot="title">$i18n{destinationLabel}</span> <span slot="title">$i18n{destinationLabel}</span>
...@@ -38,6 +37,6 @@ ...@@ -38,6 +37,6 @@
hidden$="[[!statusText_]]"> hidden$="[[!statusText_]]">
<div slot="title"></div> <div slot="title"></div>
<div slot="controls"> <div slot="controls">
<div class="destination-status"></div> <div class="destination-status">[[statusText_]]</div>
</div> </div>
</print-preview-settings-section> </print-preview-settings-section>
...@@ -21,7 +21,6 @@ import './throbber_css.js'; ...@@ -21,7 +21,6 @@ import './throbber_css.js';
import '../strings.m.js'; import '../strings.m.js';
import {I18nBehavior} from 'chrome://resources/js/i18n_behavior.m.js'; import {I18nBehavior} from 'chrome://resources/js/i18n_behavior.m.js';
import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js';
import {Base, html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {Base, html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
import {Destination, DestinationOrigin, PDF_DESTINATION_KEY, RecentDestination} from '../data/destination.js'; import {Destination, DestinationOrigin, PDF_DESTINATION_KEY, RecentDestination} from '../data/destination.js';
...@@ -67,7 +66,6 @@ Polymer({ ...@@ -67,7 +66,6 @@ Polymer({
statusText_: { statusText_: {
type: String, type: String,
computed: 'computeStatusText_(destination)', computed: 'computeStatusText_(destination)',
observer: 'onStatusTextSet_'
}, },
}, },
...@@ -105,9 +103,6 @@ Polymer({ ...@@ -105,9 +103,6 @@ Polymer({
// Check for the Docs or Save as PDF ids first. // Check for the Docs or Save as PDF ids first.
const keyParams = this.selectedValue.split('/'); const keyParams = this.selectedValue.split('/');
if (keyParams[0] === Destination.GooglePromotedId.DOCS) { if (keyParams[0] === Destination.GooglePromotedId.DOCS) {
if (!loadTimeData.getBoolean('cloudPrintDeprecationWarningsSuppressed')) {
return 'print-preview:save-to-drive-not-supported';
}
return 'print-preview:save-to-drive'; return 'print-preview:save-to-drive';
} }
if (keyParams[0] === Destination.GooglePromotedId.SAVE_AS_PDF) { if (keyParams[0] === Destination.GooglePromotedId.SAVE_AS_PDF) {
...@@ -163,20 +158,9 @@ Polymer({ ...@@ -163,20 +158,9 @@ Polymer({
return ''; return '';
} }
if (this.destination.shouldShowInvalidCertificateError) { return this.destination.shouldShowInvalidCertificateError ?
return this.i18n('noLongerSupportedFragment'); this.i18n('noLongerSupportedFragment') :
} this.destination.connectionStatusText;
if (this.destination.shouldShowSaveToDriveWarning) {
return this.i18nAdvanced('saveToDriveNotSupportedWarning');
}
return this.destination.connectionStatusText;
},
/** @private */
onStatusTextSet_() {
this.$$('.destination-status').innerHTML = this.statusText_;
}, },
/** /**
......
...@@ -32,7 +32,10 @@ ...@@ -32,7 +32,10 @@
.destination-status { .destination-status {
color: var(--cr-secondary-text-color); color: var(--cr-secondary-text-color);
font-size: calc(12/13 * 1em); font-size: calc(12/13 * 1em);
padding: 4px 0; overflow: hidden;
padding-top: 4px;
text-overflow: ellipsis;
white-space: nowrap;
} }
</style> </style>
</template> </template>
...@@ -50,7 +50,6 @@ ...@@ -50,7 +50,6 @@
#include "chrome/grit/print_preview_resources.h" #include "chrome/grit/print_preview_resources.h"
#include "chrome/grit/print_preview_resources_map.h" #include "chrome/grit/print_preview_resources_map.h"
#include "chromeos/constants/chromeos_features.h" #include "chromeos/constants/chromeos_features.h"
#include "components/cloud_devices/common/cloud_devices_urls.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "components/printing/common/print_messages.h" #include "components/printing/common/print_messages.h"
#include "components/strings/grit/components_strings.h" #include "components/strings/grit/components_strings.h"
...@@ -351,18 +350,6 @@ void AddPrintPreviewStrings(content::WebUIDataSource* source) { ...@@ -351,18 +350,6 @@ void AddPrintPreviewStrings(content::WebUIDataSource* source) {
chrome::kCloudPrintCertificateErrorLearnMoreURL); chrome::kCloudPrintCertificateErrorLearnMoreURL);
#if !defined(OS_CHROMEOS) #if !defined(OS_CHROMEOS)
if (webui::IsEnterpriseManaged()) {
source->AddLocalizedString(
"saveToDriveNotSupportedWarning",
IDS_GOOGLE_DRIVE_OPTION_NOT_SUPPORTED_WARNING_ENTERPRISE);
} else {
source->AddString(
"saveToDriveNotSupportedWarning",
l10n_util::GetStringFUTF16(
IDS_GOOGLE_DRIVE_OPTION_NOT_SUPPORTED_WARNING,
base::ASCIIToUTF16(cloud_devices::kCloudPrintDeprecationHelpURL)));
}
const base::string16 shortcut_text(base::UTF8ToUTF16(kBasicPrintShortcut)); const base::string16 shortcut_text(base::UTF8ToUTF16(kBasicPrintShortcut));
source->AddString("systemDialogOption", source->AddString("systemDialogOption",
l10n_util::GetStringFUTF16( l10n_util::GetStringFUTF16(
......
...@@ -102,16 +102,18 @@ suite(destination_select_test.suiteName, function() { ...@@ -102,16 +102,18 @@ suite(destination_select_test.suiteName, function() {
return selectOption(destinationSelect, driveKey) return selectOption(destinationSelect, driveKey)
.then(() => { .then(() => {
const saveToDriveIcon = cloudPrintDeprecationWarningsSuppressed ?
'save-to-drive' :
'save-to-drive-not-supported';
// Icon updates early based on the ID. // Icon updates early based on the ID.
compareIcon(selectEl, saveToDriveIcon); // TODO(dhoss): This icon should be 'save-to-drive-not-supported'
// after all cloud print deprecation warnings are implemented.
compareIcon(selectEl, 'save-to-drive');
// Update the destination. // Update the destination.
destinationSelect.destination = getGoogleDriveDestination(account); destinationSelect.destination = getGoogleDriveDestination(account);
const saveToDriveIcon = cloudPrintDeprecationWarningsSuppressed ?
'save-to-drive' :
'save-to-drive-not-supported';
// Still Save to Drive icon. // Still Save to Drive icon.
compareIcon(selectEl, saveToDriveIcon); compareIcon(selectEl, saveToDriveIcon);
...@@ -153,7 +155,6 @@ suite(destination_select_test.suiteName, function() { ...@@ -153,7 +155,6 @@ suite(destination_select_test.suiteName, function() {
function testUpdateStatus(cloudPrintDeprecationWarningsSuppressed) { function testUpdateStatus(cloudPrintDeprecationWarningsSuppressed) {
loadTimeData.overrideValues({ loadTimeData.overrideValues({
offline: 'offline', offline: 'offline',
saveToDriveNotSupportedWarning: 'saveToDriveNotSupportedWarning',
}); });
assertFalse(destinationSelect.$$('.throbber-container').hidden); assertFalse(destinationSelect.$$('.throbber-container').hidden);
...@@ -170,12 +171,8 @@ suite(destination_select_test.suiteName, function() { ...@@ -170,12 +171,8 @@ suite(destination_select_test.suiteName, function() {
destinationSelect.driveDestinationKey = driveKey; destinationSelect.driveDestinationKey = driveKey;
destinationSelect.destination = getGoogleDriveDestination(account); destinationSelect.destination = getGoogleDriveDestination(account);
destinationSelect.updateDestination(); destinationSelect.updateDestination();
const saveToDriveStatus = cloudPrintDeprecationWarningsSuppressed ? assertTrue(additionalInfoEl.hidden);
'' : assertEquals('', statusEl.innerHTML);
'saveToDriveNotSupportedWarning';
assertEquals(
cloudPrintDeprecationWarningsSuppressed, additionalInfoEl.hidden);
assertEquals(saveToDriveStatus, statusEl.innerHTML);
destinationSelect.destination = recentDestinationList[0]; destinationSelect.destination = recentDestinationList[0];
destinationSelect.updateDestination(); destinationSelect.updateDestination();
......
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