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

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

Issue 14370003: Use device Robot Account to access Cloud Print. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 clearTimeout(this.autoSelectTimeout_); 301 clearTimeout(this.autoSelectTimeout_);
302 this.autoSelectTimeout_ = null; 302 this.autoSelectTimeout_ = null;
303 } 303 }
304 if (destination.id == print_preview.Destination.GooglePromotedId.FEDEX && 304 if (destination.id == print_preview.Destination.GooglePromotedId.FEDEX &&
305 !destination.isTosAccepted) { 305 !destination.isTosAccepted) {
306 assert(this.cloudPrintInterface_ != null, 306 assert(this.cloudPrintInterface_ != null,
307 'Selected FedEx Office destination, but Google Cloud Print is ' + 307 'Selected FedEx Office destination, but Google Cloud Print is ' +
308 'not enabled'); 308 'not enabled');
309 destination.isTosAccepted = true; 309 destination.isTosAccepted = true;
310 this.cloudPrintInterface_.updatePrinterTosAcceptance(destination.id, 310 this.cloudPrintInterface_.updatePrinterTosAcceptance(destination.id,
311 destination.origin,
311 true); 312 true);
312 } 313 }
313 this.appState_.persistSelectedDestination(this.selectedDestination_); 314 this.appState_.persistSelectedDestination(this.selectedDestination_);
314 cr.dispatchSimpleEvent( 315 cr.dispatchSimpleEvent(
315 this, DestinationStore.EventType.DESTINATION_SELECT); 316 this, DestinationStore.EventType.DESTINATION_SELECT);
316 if (destination.capabilities == null) { 317 if (destination.capabilities == null) {
317 if (destination.isLocal) { 318 if (destination.isLocal) {
318 this.nativeLayer_.startGetLocalDestinationCapabilities( 319 this.nativeLayer_.startGetLocalDestinationCapabilities(
319 destination.id); 320 destination.id);
320 } else { 321 } else {
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 return id == this.initialDestinationId_ && 677 return id == this.initialDestinationId_ &&
677 origin == this.initialDestinationOrigin_; 678 origin == this.initialDestinationOrigin_;
678 } 679 }
679 }; 680 };
680 681
681 // Export 682 // Export
682 return { 683 return {
683 DestinationStore: DestinationStore 684 DestinationStore: DestinationStore
684 }; 685 };
685 }); 686 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698