| 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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 if (origins.indexOf(request.origin) >= 0) { | 512 if (origins.indexOf(request.origin) >= 0) { |
| 513 request.xhr.abort(); | 513 request.xhr.abort(); |
| 514 return false; | 514 return false; |
| 515 } | 515 } |
| 516 return true; | 516 return true; |
| 517 }); | 517 }); |
| 518 }, | 518 }, |
| 519 | 519 |
| 520 /** | 520 /** |
| 521 * Called when a native layer receives access token. | 521 * Called when a native layer receives access token. |
| 522 * @param {Event} evt Contains the authentication type and access token. | 522 * @param {Event} event Contains the authentication type and access token. |
| 523 * @private | 523 * @private |
| 524 */ | 524 */ |
| 525 onAccessTokenReady_: function(event) { | 525 onAccessTokenReady_: function(event) { |
| 526 // TODO(vitalybuka): remove when other Origins implemented. | 526 // TODO(vitalybuka): remove when other Origins implemented. |
| 527 assert(event.authType == print_preview.Destination.Origin.DEVICE); | 527 assert(event.authType == print_preview.Destination.Origin.DEVICE); |
| 528 this.requestQueue_ = this.requestQueue_.filter(function(request) { | 528 this.requestQueue_ = this.requestQueue_.filter(function(request) { |
| 529 assert(request.origin == print_preview.Destination.Origin.DEVICE); | 529 assert(request.origin == print_preview.Destination.Origin.DEVICE); |
| 530 if (request.origin != event.authType) { | 530 if (request.origin != event.authType) { |
| 531 return true; | 531 return true; |
| 532 } | 532 } |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 844 * @type {string} | 844 * @type {string} |
| 845 */ | 845 */ |
| 846 this.value = value; | 846 this.value = value; |
| 847 }; | 847 }; |
| 848 | 848 |
| 849 // Export | 849 // Export |
| 850 return { | 850 return { |
| 851 CloudPrintInterface: CloudPrintInterface | 851 CloudPrintInterface: CloudPrintInterface |
| 852 }; | 852 }; |
| 853 }); | 853 }); |
| OLD | NEW |