Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(332)

Side by Side Diff: chrome/browser/resources/print_preview/search/destination_search.js

Issue 2838603004: Re-enable Cloud printers for ChromeOS kiosks. (Closed)
Patch Set: narrow criteria Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/test/data/webui/print_preview_destination_search_test.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('print_preview', function() { 5 cr.define('print_preview', function() {
6 'use strict'; 6 'use strict';
7 7
8 /** 8 /**
9 * Component used for searching for a print destination. 9 * Component used for searching for a print destination.
10 * This is a modal dialog that allows the user to search and select a 10 * This is a modal dialog that allows the user to search and select a
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 /** 578 /**
579 * Handler for {@code print_preview.DestinationListItem.EventType. 579 * Handler for {@code print_preview.DestinationListItem.EventType.
580 * CONFIGURE_REQUEST} event, which is called to check a destination list 580 * CONFIGURE_REQUEST} event, which is called to check a destination list
581 * item needs to be setup on Chrome OS before being selected. Note we do not 581 * item needs to be setup on Chrome OS before being selected. Note we do not
582 * allow configuring more than one destination at the same time. 582 * allow configuring more than one destination at the same time.
583 * @param {!CustomEvent} event Contains the destination needs to be setup. 583 * @param {!CustomEvent} event Contains the destination needs to be setup.
584 * @private 584 * @private
585 */ 585 */
586 onDestinationConfigureRequest_: function(event) { 586 onDestinationConfigureRequest_: function(event) {
587 var destination = event.detail.destination; 587 var destination = event.detail.destination;
588 var destinationItem = destination.isLocal ? 588 // Cloud Print Device printers are stored in the local list
589 this.localList_.getDestinationItem(destination.id) : 589 // crbug.com/713831.
590 this.cloudList_.getDestinationItem(destination.id); 590 // TODO(crbug.com/416701): Upon resolution, update this.
591 var destinationItem = (destination.isLocal ||
592 destination.origin == print_preview.Destination.Origin.DEVICE) ?
Lei Zhang 2017/04/25 01:20:45 Indentation looks wonky. Should be 4 from var, and
skau 2017/04/25 01:45:47 I ran it through the C++ formatter and positioned
593 this.localList_.getDestinationItem(destination.id) :
594 this.cloudList_.getDestinationItem(destination.id);
591 assert(destinationItem != null, 595 assert(destinationItem != null,
592 'User does not select a valid destination item.'); 596 'User does not select a valid destination item.');
593 597
594 // Another printer setup is in process or the printer doesn't need to be 598 // Another printer setup is in process or the printer doesn't need to be
595 // set up. Reject the setup request directly. 599 // set up. Reject the setup request directly.
596 if (this.destinationInConfiguring_ != null || 600 if (this.destinationInConfiguring_ != null ||
597 destination.origin != print_preview.Destination.Origin.CROS || 601 destination.origin != print_preview.Destination.Origin.CROS ||
598 destination.capabilities != null) { 602 destination.capabilities != null) {
599 destinationItem.onConfigureRequestRejected( 603 destinationItem.onConfigureRequestRejected(
600 this.destinationInConfiguring_ != null); 604 this.destinationInConfiguring_ != null);
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 onWindowResize_: function() { 834 onWindowResize_: function() {
831 this.reflowLists_(); 835 this.reflowLists_();
832 } 836 }
833 }; 837 };
834 838
835 // Export 839 // Export
836 return { 840 return {
837 DestinationSearch: DestinationSearch 841 DestinationSearch: DestinationSearch
838 }; 842 };
839 }); 843 });
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/webui/print_preview_destination_search_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698