| 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.exportPath('print_preview'); | 5 cr.exportPath('print_preview'); |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * @typedef {{selectSaveAsPdfDestination: boolean, | 8 * @typedef {{selectSaveAsPdfDestination: boolean, |
| 9 * layoutSettings.portrait: boolean, | 9 * layoutSettings.portrait: boolean, |
| 10 * pageRange: string, | 10 * pageRange: string, |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 NativeLayer.EventType = { | 119 NativeLayer.EventType = { |
| 120 ACCESS_TOKEN_READY: 'print_preview.NativeLayer.ACCESS_TOKEN_READY', | 120 ACCESS_TOKEN_READY: 'print_preview.NativeLayer.ACCESS_TOKEN_READY', |
| 121 CAPABILITIES_SET: 'print_preview.NativeLayer.CAPABILITIES_SET', | 121 CAPABILITIES_SET: 'print_preview.NativeLayer.CAPABILITIES_SET', |
| 122 CLOUD_PRINT_ENABLE: 'print_preview.NativeLayer.CLOUD_PRINT_ENABLE', | 122 CLOUD_PRINT_ENABLE: 'print_preview.NativeLayer.CLOUD_PRINT_ENABLE', |
| 123 DESTINATIONS_RELOAD: 'print_preview.NativeLayer.DESTINATIONS_RELOAD', | 123 DESTINATIONS_RELOAD: 'print_preview.NativeLayer.DESTINATIONS_RELOAD', |
| 124 DISABLE_SCALING: 'print_preview.NativeLayer.DISABLE_SCALING', | 124 DISABLE_SCALING: 'print_preview.NativeLayer.DISABLE_SCALING', |
| 125 FILE_SELECTION_CANCEL: 'print_preview.NativeLayer.FILE_SELECTION_CANCEL', | 125 FILE_SELECTION_CANCEL: 'print_preview.NativeLayer.FILE_SELECTION_CANCEL', |
| 126 FILE_SELECTION_COMPLETE: | 126 FILE_SELECTION_COMPLETE: |
| 127 'print_preview.NativeLayer.FILE_SELECTION_COMPLETE', | 127 'print_preview.NativeLayer.FILE_SELECTION_COMPLETE', |
| 128 GET_CAPABILITIES_FAIL: 'print_preview.NativeLayer.GET_CAPABILITIES_FAIL', | 128 GET_CAPABILITIES_FAIL: 'print_preview.NativeLayer.GET_CAPABILITIES_FAIL', |
| 129 LOCAL_DESTINATIONS_SET: 'print_preview.NativeLayer.LOCAL_DESTINATIONS_SET', | |
| 130 MANIPULATE_SETTINGS_FOR_TEST: | 129 MANIPULATE_SETTINGS_FOR_TEST: |
| 131 'print_preview.NativeLayer.MANIPULATE_SETTINGS_FOR_TEST', | 130 'print_preview.NativeLayer.MANIPULATE_SETTINGS_FOR_TEST', |
| 132 PAGE_COUNT_READY: 'print_preview.NativeLayer.PAGE_COUNT_READY', | 131 PAGE_COUNT_READY: 'print_preview.NativeLayer.PAGE_COUNT_READY', |
| 133 PAGE_LAYOUT_READY: 'print_preview.NativeLayer.PAGE_LAYOUT_READY', | 132 PAGE_LAYOUT_READY: 'print_preview.NativeLayer.PAGE_LAYOUT_READY', |
| 134 PAGE_PREVIEW_READY: 'print_preview.NativeLayer.PAGE_PREVIEW_READY', | 133 PAGE_PREVIEW_READY: 'print_preview.NativeLayer.PAGE_PREVIEW_READY', |
| 135 PREVIEW_GENERATION_DONE: | 134 PREVIEW_GENERATION_DONE: |
| 136 'print_preview.NativeLayer.PREVIEW_GENERATION_DONE', | 135 'print_preview.NativeLayer.PREVIEW_GENERATION_DONE', |
| 137 PREVIEW_GENERATION_FAIL: | 136 PREVIEW_GENERATION_FAIL: |
| 138 'print_preview.NativeLayer.PREVIEW_GENERATION_FAIL', | 137 'print_preview.NativeLayer.PREVIEW_GENERATION_FAIL', |
| 139 PRINT_TO_CLOUD: 'print_preview.NativeLayer.PRINT_TO_CLOUD', | 138 PRINT_TO_CLOUD: 'print_preview.NativeLayer.PRINT_TO_CLOUD', |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 initialSettings['initiatorTitle'] || '', | 220 initialSettings['initiatorTitle'] || '', |
| 222 initialSettings['documentHasSelection'] || false, | 221 initialSettings['documentHasSelection'] || false, |
| 223 initialSettings['shouldPrintSelectionOnly'] || false, | 222 initialSettings['shouldPrintSelectionOnly'] || false, |
| 224 initialSettings['printerName'] || null, | 223 initialSettings['printerName'] || null, |
| 225 initialSettings['appState'] || null, | 224 initialSettings['appState'] || null, |
| 226 initialSettings['defaultDestinationSelectionRules'] || null); | 225 initialSettings['defaultDestinationSelectionRules'] || null); |
| 227 }); | 226 }); |
| 228 }, | 227 }, |
| 229 | 228 |
| 230 /** | 229 /** |
| 231 * Requests the system's local print destinations. A LOCAL_DESTINATIONS_SET | 230 * Requests the system's local print destinations. The promise will be |
| 232 * event will be dispatched in response. | 231 * resolved with a list of the local destinations. |
| 233 * @return {!Promise<!Array<print_preview.LocalDestinationInfo>>} | 232 * @return {!Promise<!Array<print_preview.LocalDestinationInfo>>} |
| 234 */ | 233 */ |
| 235 getPrinters: function() { | 234 getPrinters: function() { |
| 236 return cr.sendWithPromise('getPrinters'); | 235 return cr.sendWithPromise('getPrinters'); |
| 237 }, | 236 }, |
| 238 | 237 |
| 239 /** | 238 /** |
| 240 * Requests the network's privet print destinations. A number of | 239 * Requests the network's privet print destinations. A number of |
| 241 * PRIVET_PRINTER_CHANGED events will be fired in response, followed by a | 240 * PRIVET_PRINTER_CHANGED events will be fired in response, followed by a |
| 242 * PRIVET_SEARCH_ENDED. | 241 * PRIVET_SEARCH_ENDED. |
| (...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1114 return this.serializedDefaultDestinationSelectionRulesStr_; | 1113 return this.serializedDefaultDestinationSelectionRulesStr_; |
| 1115 } | 1114 } |
| 1116 }; | 1115 }; |
| 1117 | 1116 |
| 1118 // Export | 1117 // Export |
| 1119 return { | 1118 return { |
| 1120 NativeInitialSettings: NativeInitialSettings, | 1119 NativeInitialSettings: NativeInitialSettings, |
| 1121 NativeLayer: NativeLayer | 1120 NativeLayer: NativeLayer |
| 1122 }; | 1121 }; |
| 1123 }); | 1122 }); |
| OLD | NEW |