| 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 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 } | 749 } |
| 750 var printerDoneEvent = | 750 var printerDoneEvent = |
| 751 new Event(CloudPrintInterface.EventType.PRINTER_DONE); | 751 new Event(CloudPrintInterface.EventType.PRINTER_DONE); |
| 752 printerDoneEvent.printer = printer; | 752 printerDoneEvent.printer = printer; |
| 753 this.dispatchEvent(printerDoneEvent); | 753 this.dispatchEvent(printerDoneEvent); |
| 754 } else { | 754 } else { |
| 755 var errorEvent = this.createErrorEvent_( | 755 var errorEvent = this.createErrorEvent_( |
| 756 CloudPrintInterface.EventType.PRINTER_FAILED, request); | 756 CloudPrintInterface.EventType.PRINTER_FAILED, request); |
| 757 errorEvent.destinationId = destinationId; | 757 errorEvent.destinationId = destinationId; |
| 758 errorEvent.destinationOrigin = request.origin; | 758 errorEvent.destinationOrigin = request.origin; |
| 759 this.dispatchEvent(errorEvent, request.origin); | 759 this.dispatchEvent(errorEvent); |
| 760 } | 760 } |
| 761 }, | 761 }, |
| 762 | 762 |
| 763 /** | 763 /** |
| 764 * Called when the update printer TOS acceptance request completes. | 764 * Called when the update printer TOS acceptance request completes. |
| 765 * @param {!CloudPrintRequest} request Request that has been completed. | 765 * @param {!CloudPrintRequest} request Request that has been completed. |
| 766 * @private | 766 * @private |
| 767 */ | 767 */ |
| 768 onUpdatePrinterTosAcceptanceDone_: function(request) { | 768 onUpdatePrinterTosAcceptanceDone_: function(request) { |
| 769 if (request.xhr.status == 200 && request.result['success']) { | 769 if (request.xhr.status == 200 && request.result['success']) { |
| (...skipping 74 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 |