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('print_preview', function() { | 5 cr.define('print_preview', function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 /** | 8 /** |
9 * An interface to the native Chromium printing system layer. | 9 * An interface to the native Chromium printing system layer. |
10 * @constructor | 10 * @constructor |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 NativeLayer.SERIALIZED_STATE_VERSION_ = 1; | 100 NativeLayer.SERIALIZED_STATE_VERSION_ = 1; |
101 | 101 |
102 NativeLayer.prototype = { | 102 NativeLayer.prototype = { |
103 __proto__: cr.EventTarget.prototype, | 103 __proto__: cr.EventTarget.prototype, |
104 | 104 |
105 /** | 105 /** |
106 * Requests access token for cloud print requests. | 106 * Requests access token for cloud print requests. |
107 * @param {string} authType type of access token. | 107 * @param {string} authType type of access token. |
108 */ | 108 */ |
109 startGetAccessToken: function(authType) { | 109 startGetAccessToken: function(authType) { |
110 chrome.send('getAccessToken', [authType]); | 110 chrome.send('getAccessToken', [/*authType*/ 'profile']); |
111 }, | 111 }, |
112 | 112 |
113 /** Gets the initial settings to initialize the print preview with. */ | 113 /** Gets the initial settings to initialize the print preview with. */ |
114 startGetInitialSettings: function() { | 114 startGetInitialSettings: function() { |
115 chrome.send('getInitialSettings'); | 115 chrome.send('getInitialSettings'); |
116 }, | 116 }, |
117 | 117 |
118 /** | 118 /** |
119 * Requests the system's local print destinations. A LOCAL_DESTINATIONS_SET | 119 * Requests the system's local print destinations. A LOCAL_DESTINATIONS_SET |
120 * event will be dispatched in response. | 120 * event will be dispatched in response. |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 | 533 |
534 /** | 534 /** |
535 * Notification that access token is ready. | 535 * Notification that access token is ready. |
536 * @param {string} authType Type of access token. | 536 * @param {string} authType Type of access token. |
537 * @param {string} accessToken Access token. | 537 * @param {string} accessToken Access token. |
538 * @private | 538 * @private |
539 */ | 539 */ |
540 onDidGetAccessToken_: function(authType, accessToken) { | 540 onDidGetAccessToken_: function(authType, accessToken) { |
541 var getAccessTokenEvent = new cr.Event( | 541 var getAccessTokenEvent = new cr.Event( |
542 NativeLayer.EventType.ACCESS_TOKEN_READY); | 542 NativeLayer.EventType.ACCESS_TOKEN_READY); |
543 getAccessTokenEvent.authType = authType; | 543 getAccessTokenEvent.authType = /*authType*/ 'device'; |
544 getAccessTokenEvent.accessToken = accessToken; | 544 getAccessTokenEvent.accessToken = accessToken; |
545 this.dispatchEvent(getAccessTokenEvent); | 545 this.dispatchEvent(getAccessTokenEvent); |
546 }, | 546 }, |
547 | 547 |
548 /** | 548 /** |
549 * Update the print preview when new preview data is available. | 549 * Update the print preview when new preview data is available. |
550 * Create the PDF plugin as needed. | 550 * Create the PDF plugin as needed. |
551 * Called from PrintPreviewUI::PreviewDataIsAvailable(). | 551 * Called from PrintPreviewUI::PreviewDataIsAvailable(). |
552 * @param {number} previewUid Preview unique identifier. | 552 * @param {number} previewUid Preview unique identifier. |
553 * @param {number} previewResponseId The preview request id that resulted in | 553 * @param {number} previewResponseId The preview request id that resulted in |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 return this.serializedAppStateStr_; | 734 return this.serializedAppStateStr_; |
735 } | 735 } |
736 }; | 736 }; |
737 | 737 |
738 // Export | 738 // Export |
739 return { | 739 return { |
740 NativeInitialSettings: NativeInitialSettings, | 740 NativeInitialSettings: NativeInitialSettings, |
741 NativeLayer: NativeLayer | 741 NativeLayer: NativeLayer |
742 }; | 742 }; |
743 }); | 743 }); |
OLD | NEW |