OLD | NEW |
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('cloudprint', function() { | 5 cr.define('cloudprint', function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 /** | 8 /** |
9 * API to the Google Cloud Print service. | 9 * API to the Google Cloud Print service. |
10 * @param {string} baseUrl Base part of the Google Cloud Print service URL | 10 * @param {string} baseUrl Base part of the Google Cloud Print service URL |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 if (origins.indexOf(request.origin) >= 0) { | 469 if (origins.indexOf(request.origin) >= 0) { |
470 request.xhr.abort(); | 470 request.xhr.abort(); |
471 return false; | 471 return false; |
472 } | 472 } |
473 return true; | 473 return true; |
474 }); | 474 }); |
475 }, | 475 }, |
476 | 476 |
477 /** | 477 /** |
478 * Called when a native layer receives access token. | 478 * Called when a native layer receives access token. |
479 * @param {Event} evt Contains the authentication type and access token. | 479 * @param {Event} event Contains the authentication type and access token. |
480 * @private | 480 * @private |
481 */ | 481 */ |
482 onAccessTokenReady_: function(event) { | 482 onAccessTokenReady_: function(event) { |
483 // TODO(vitalybuka): remove when other Origins implemented. | 483 // TODO(vitalybuka): remove when other Origins implemented. |
484 assert(event.authType == print_preview.Destination.Origin.DEVICE); | 484 assert(event.authType == print_preview.Destination.Origin.DEVICE); |
485 this.requestQueue_ = this.requestQueue_.filter(function(request) { | 485 this.requestQueue_ = this.requestQueue_.filter(function(request) { |
486 assert(request.origin == print_preview.Destination.Origin.DEVICE); | 486 assert(request.origin == print_preview.Destination.Origin.DEVICE); |
487 if (request.origin != event.authType) { | 487 if (request.origin != event.authType) { |
488 return true; | 488 return true; |
489 } | 489 } |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 * @type {string} | 734 * @type {string} |
735 */ | 735 */ |
736 this.value = value; | 736 this.value = value; |
737 }; | 737 }; |
738 | 738 |
739 // Export | 739 // Export |
740 return { | 740 return { |
741 CloudPrintInterface: CloudPrintInterface | 741 CloudPrintInterface: CloudPrintInterface |
742 }; | 742 }; |
743 }); | 743 }); |
OLD | NEW |