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

Side by Side Diff: chrome/browser/resources/print_preview/data/destination_store.js

Issue 574193002: Compile print_preview, part 1: remove all warnings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@true_master
Patch Set: Created 6 years, 3 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
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 * A data store that stores destinations and dispatches events when the data 9 * A data store that stores destinations and dispatches events when the data
10 * store changes. 10 * store changes.
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 */ 372 */
373 hasOnlyDefaultCloudDestinations: function() { 373 hasOnlyDefaultCloudDestinations: function() {
374 // TODO: Move the logic to print_preview. 374 // TODO: Move the logic to print_preview.
375 return this.destinations_.every(function(dest) { 375 return this.destinations_.every(function(dest) {
376 return dest.isLocal || 376 return dest.isLocal ||
377 dest.id == print_preview.Destination.GooglePromotedId.DOCS || 377 dest.id == print_preview.Destination.GooglePromotedId.DOCS ||
378 dest.id == print_preview.Destination.GooglePromotedId.FEDEX; 378 dest.id == print_preview.Destination.GooglePromotedId.FEDEX;
379 }); 379 });
380 }, 380 },
381 381
382 /** @param {!print_preview.Destination} Destination to select. */ 382 /**
383 * @param {!print_preview.Destination} destination Destination to select.
384 */
383 selectDestination: function(destination) { 385 selectDestination: function(destination) {
384 this.isInAutoSelectMode_ = false; 386 this.isInAutoSelectMode_ = false;
385 // When auto select expires, DESTINATION_SELECT event has to be dispatched 387 // When auto select expires, DESTINATION_SELECT event has to be dispatched
386 // anyway (see isAutoSelectDestinationInProgress() logic). 388 // anyway (see isAutoSelectDestinationInProgress() logic).
387 if (this.autoSelectTimeout_) { 389 if (this.autoSelectTimeout_) {
388 clearTimeout(this.autoSelectTimeout_); 390 clearTimeout(this.autoSelectTimeout_);
389 this.autoSelectTimeout_ = null; 391 this.autoSelectTimeout_ = null;
390 } else if (destination == this.selectedDestination_) { 392 } else if (destination == this.selectedDestination_) {
391 return; 393 return;
392 } 394 }
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 this.hasLoadedAllLocalDestinations_ = false; 700 this.hasLoadedAllLocalDestinations_ = false;
699 701
700 clearTimeout(this.autoSelectTimeout_); 702 clearTimeout(this.autoSelectTimeout_);
701 this.autoSelectTimeout_ = setTimeout( 703 this.autoSelectTimeout_ = setTimeout(
702 this.selectDefaultDestination_.bind(this), 704 this.selectDefaultDestination_.bind(this),
703 DestinationStore.AUTO_SELECT_TIMEOUT_); 705 DestinationStore.AUTO_SELECT_TIMEOUT_);
704 }, 706 },
705 707
706 /** 708 /**
707 * Called when the local destinations have been got from the native layer. 709 * Called when the local destinations have been got from the native layer.
708 * @param {Event} Contains the local destinations. 710 * @param {Event} event Contains the local destinations.
709 * @private 711 * @private
710 */ 712 */
711 onLocalDestinationsSet_: function(event) { 713 onLocalDestinationsSet_: function(event) {
712 var localDestinations = event.destinationInfos.map(function(destInfo) { 714 var localDestinations = event.destinationInfos.map(function(destInfo) {
713 return print_preview.LocalDestinationParser.parse(destInfo); 715 return print_preview.LocalDestinationParser.parse(destInfo);
714 }); 716 });
715 this.insertDestinations_(localDestinations); 717 this.insertDestinations_(localDestinations);
716 this.isLocalDestinationSearchInProgress_ = false; 718 this.isLocalDestinationSearchInProgress_ = false;
717 cr.dispatchSimpleEvent( 719 cr.dispatchSimpleEvent(
718 this, DestinationStore.EventType.DESTINATION_SEARCH_DONE); 720 this, DestinationStore.EventType.DESTINATION_SEARCH_DONE);
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
926 return id == this.appState_.selectedDestinationId && 928 return id == this.appState_.selectedDestinationId &&
927 origin == this.appState_.selectedDestinationOrigin; 929 origin == this.appState_.selectedDestinationOrigin;
928 } 930 }
929 }; 931 };
930 932
931 // Export 933 // Export
932 return { 934 return {
933 DestinationStore: DestinationStore 935 DestinationStore: DestinationStore
934 }; 936 };
935 }); 937 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698