Commit ef69e190 authored by Gavin Williams's avatar Gavin Williams Committed by Commit Bot

Stop showing Save to Drive in Destination Dialog for CrOS

With the impending deprecation of Google Cloud Print (GCP), CrOS has
shifted to implementing Save to Drive using the local Drive folder. Thus
the Save to Drive option should be removed from Destination Dialog which
has an account picker. Without GCP, the user no longer has the ability
to choose which account's Drive to save to.

Bug: 1112416
Change-Id: I985ebae6948a96e6698edad11b580cb3a87ff361
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2387427Reviewed-by: default avatarRebekah Potter <rbpotter@chromium.org>
Commit-Queue: Gavin Williams <gavinwill@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805141}
parent 7ae757f7
...@@ -24,6 +24,7 @@ import {assert} from 'chrome://resources/js/assert.m.js'; ...@@ -24,6 +24,7 @@ import {assert} from 'chrome://resources/js/assert.m.js';
import {EventTracker} from 'chrome://resources/js/event_tracker.m.js'; import {EventTracker} from 'chrome://resources/js/event_tracker.m.js';
import {I18nBehavior} from 'chrome://resources/js/i18n_behavior.m.js'; import {I18nBehavior} from 'chrome://resources/js/i18n_behavior.m.js';
import {ListPropertyUpdateBehavior} from 'chrome://resources/js/list_property_update_behavior.m.js'; import {ListPropertyUpdateBehavior} from 'chrome://resources/js/list_property_update_behavior.m.js';
import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js';
import {beforeNextRender, html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {beforeNextRender, html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
import {Destination} from '../data/destination.js'; import {Destination} from '../data/destination.js';
...@@ -93,6 +94,17 @@ Polymer({ ...@@ -93,6 +94,17 @@ Polymer({
type: Object, type: Object,
value: null, value: null,
}, },
// <if expr="chromeos">
/** @private */
saveToDriveFlagEnabled_: {
type: Boolean,
value() {
return loadTimeData.getBoolean('printSaveToDrive');
},
readOnly: true,
},
// </if>
}, },
listeners: { listeners: {
...@@ -197,12 +209,32 @@ Polymer({ ...@@ -197,12 +209,32 @@ Polymer({
this.updateList( this.updateList(
'destinations_', destination => destination.key, 'destinations_', destination => destination.key,
this.destinationStore.destinations(this.activeUser)); this.getDestinationList_());
this.loadingDestinations_ = this.loadingDestinations_ =
this.destinationStore.isPrintDestinationSearchInProgress; this.destinationStore.isPrintDestinationSearchInProgress;
}, },
/**
* @return {!Array<!Destination>}
* @private
*/
getDestinationList_() {
const destinations = this.destinationStore.destinations(this.activeUser);
// <if expr="chromeos">
// When |saveToDriveFlagEnabled_| is true, we don't want to show a
// 'Save to Drive' option in the destination dialog.
if (this.saveToDriveFlagEnabled_) {
return destinations.filter(
destination => destination.id !== Destination.GooglePromotedId.DOCS &&
destination.id !==
Destination.GooglePromotedId.SAVE_TO_DRIVE_CROS);
}
// </if>
return destinations;
},
/** @private */ /** @private */
onCloseOrCancel_() { onCloseOrCancel_() {
if (this.searchQuery_) { if (this.searchQuery_) {
......
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