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

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

Issue 2863183004: Print Preview: Fix top level directory compile errors (Closed)
Patch Set: Address comments Created 3 years, 7 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 895 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 906
907 /** 907 /**
908 * Sets the destination store's Google Cloud Print interface. 908 * Sets the destination store's Google Cloud Print interface.
909 * @param {!cloudprint.CloudPrintInterface} cloudPrintInterface Interface 909 * @param {!cloudprint.CloudPrintInterface} cloudPrintInterface Interface
910 * to set. 910 * to set.
911 */ 911 */
912 setCloudPrintInterface: function(cloudPrintInterface) { 912 setCloudPrintInterface: function(cloudPrintInterface) {
913 this.cloudPrintInterface_ = cloudPrintInterface; 913 this.cloudPrintInterface_ = cloudPrintInterface;
914 this.tracker_.add( 914 this.tracker_.add(
915 this.cloudPrintInterface_, 915 this.cloudPrintInterface_,
916 cloudprint.CloudPrintInterface.EventType.SEARCH_DONE, 916 cloudprint.CloudPrintInterfaceEventType.SEARCH_DONE,
917 this.onCloudPrintSearchDone_.bind(this)); 917 this.onCloudPrintSearchDone_.bind(this));
918 this.tracker_.add( 918 this.tracker_.add(
919 this.cloudPrintInterface_, 919 this.cloudPrintInterface_,
920 cloudprint.CloudPrintInterface.EventType.SEARCH_FAILED, 920 cloudprint.CloudPrintInterfaceEventType.SEARCH_FAILED,
921 this.onCloudPrintSearchDone_.bind(this)); 921 this.onCloudPrintSearchDone_.bind(this));
922 this.tracker_.add( 922 this.tracker_.add(
923 this.cloudPrintInterface_, 923 this.cloudPrintInterface_,
924 cloudprint.CloudPrintInterface.EventType.PRINTER_DONE, 924 cloudprint.CloudPrintInterfaceEventType.PRINTER_DONE,
925 this.onCloudPrintPrinterDone_.bind(this)); 925 this.onCloudPrintPrinterDone_.bind(this));
926 this.tracker_.add( 926 this.tracker_.add(
927 this.cloudPrintInterface_, 927 this.cloudPrintInterface_,
928 cloudprint.CloudPrintInterface.EventType.PRINTER_FAILED, 928 cloudprint.CloudPrintInterfaceEventType.PRINTER_FAILED,
929 this.onCloudPrintPrinterFailed_.bind(this)); 929 this.onCloudPrintPrinterFailed_.bind(this));
930 this.tracker_.add( 930 this.tracker_.add(
931 this.cloudPrintInterface_, 931 this.cloudPrintInterface_,
932 cloudprint.CloudPrintInterface.EventType.PROCESS_INVITE_DONE, 932 cloudprint.CloudPrintInterfaceEventType.PROCESS_INVITE_DONE,
933 this.onCloudPrintProcessInviteDone_.bind(this)); 933 this.onCloudPrintProcessInviteDone_.bind(this));
934 }, 934 },
935 935
936 /** 936 /**
937 * @return {boolean} Whether only default cloud destinations have been 937 * @return {boolean} Whether only default cloud destinations have been
938 * loaded. 938 * loaded.
939 */ 939 */
940 hasOnlyDefaultCloudDestinations: function() { 940 hasOnlyDefaultCloudDestinations: function() {
941 // TODO: Move the logic to print_preview. 941 // TODO: Move the logic to print_preview.
942 return this.destinations_.every(function(dest) { 942 return this.destinations_.every(function(dest) {
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
1121 * Initiates loading of cloud destinations. 1121 * Initiates loading of cloud destinations.
1122 * @param {print_preview.DestinationOrigin=} opt_origin Search destinations 1122 * @param {print_preview.DestinationOrigin=} opt_origin Search destinations
1123 * for the specified origin only. 1123 * for the specified origin only.
1124 */ 1124 */
1125 startLoadCloudDestinations: function(opt_origin) { 1125 startLoadCloudDestinations: function(opt_origin) {
1126 if (this.cloudPrintInterface_ != null) { 1126 if (this.cloudPrintInterface_ != null) {
1127 var origins = this.loadedCloudOrigins_[this.userInfo_.activeUser] || []; 1127 var origins = this.loadedCloudOrigins_[this.userInfo_.activeUser] || [];
1128 if (origins.length == 0 || 1128 if (origins.length == 0 ||
1129 (opt_origin && origins.indexOf(opt_origin) < 0)) { 1129 (opt_origin && origins.indexOf(opt_origin) < 0)) {
1130 this.cloudPrintInterface_.search( 1130 this.cloudPrintInterface_.search(
1131 this.userInfo_.activeUser || '', opt_origin); 1131 this.userInfo_.activeUser, opt_origin);
1132 cr.dispatchSimpleEvent( 1132 cr.dispatchSimpleEvent(
1133 this, DestinationStore.EventType.DESTINATION_SEARCH_STARTED); 1133 this, DestinationStore.EventType.DESTINATION_SEARCH_STARTED);
1134 } 1134 }
1135 } 1135 }
1136 }, 1136 },
1137 1137
1138 /** Requests load of COOKIE based cloud destinations. */ 1138 /** Requests load of COOKIE based cloud destinations. */
1139 reloadUserCookieBasedDestinations: function() { 1139 reloadUserCookieBasedDestinations: function() {
1140 var origins = this.loadedCloudOrigins_[this.userInfo_.activeUser] || []; 1140 var origins = this.loadedCloudOrigins_[this.userInfo_.activeUser] || [];
1141 if (origins.indexOf(print_preview.DestinationOrigin.COOKIES) >= 0) { 1141 if (origins.indexOf(print_preview.DestinationOrigin.COOKIES) >= 0) {
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
1696 return this.getDestinationKey_( 1696 return this.getDestinationKey_(
1697 destination.origin, destination.id, destination.account); 1697 destination.origin, destination.id, destination.account);
1698 } 1698 }
1699 }; 1699 };
1700 1700
1701 // Export 1701 // Export
1702 return { 1702 return {
1703 DestinationStore: DestinationStore 1703 DestinationStore: DestinationStore
1704 }; 1704 };
1705 }); 1705 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/print_preview/component.js ('k') | chrome/browser/resources/print_preview/data/invitation_store.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698