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

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: fix indentation 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 =
592 (destination.isLocal ||
593 destination.origin == print_preview.Destination.Origin.DEVICE) ?
594 this.localList_.getDestinationItem(destination.id) :
595 this.cloudList_.getDestinationItem(destination.id);
591 assert(destinationItem != null, 596 assert(destinationItem != null,
592 'User does not select a valid destination item.'); 597 'User does not select a valid destination item.');
593 598
594 // Another printer setup is in process or the printer doesn't need to be 599 // Another printer setup is in process or the printer doesn't need to be
595 // set up. Reject the setup request directly. 600 // set up. Reject the setup request directly.
596 if (this.destinationInConfiguring_ != null || 601 if (this.destinationInConfiguring_ != null ||
597 destination.origin != print_preview.Destination.Origin.CROS || 602 destination.origin != print_preview.Destination.Origin.CROS ||
598 destination.capabilities != null) { 603 destination.capabilities != null) {
599 destinationItem.onConfigureRequestRejected( 604 destinationItem.onConfigureRequestRejected(
600 this.destinationInConfiguring_ != null); 605 this.destinationInConfiguring_ != null);
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 onWindowResize_: function() { 835 onWindowResize_: function() {
831 this.reflowLists_(); 836 this.reflowLists_();
832 } 837 }
833 }; 838 };
834 839
835 // Export 840 // Export
836 return { 841 return {
837 DestinationSearch: DestinationSearch 842 DestinationSearch: DestinationSearch
838 }; 843 };
839 }); 844 });
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