| Index: chrome/browser/resources/print_preview/native_layer.js
|
| diff --git a/chrome/browser/resources/print_preview/native_layer.js b/chrome/browser/resources/print_preview/native_layer.js
|
| index 8c72a538284ac3e98bdaeda005022f06bf5b9754..621670a2e6d11a7eeeb88ab15776da69b3aa5113 100644
|
| --- a/chrome/browser/resources/print_preview/native_layer.js
|
| +++ b/chrome/browser/resources/print_preview/native_layer.js
|
| @@ -67,6 +67,10 @@ cr.define('print_preview', function() {
|
| this.onEnableManipulateSettingsForTest_.bind(this);
|
| global.printPresetOptionsFromDocument =
|
| this.onPrintPresetOptionsFromDocument_.bind(this);
|
| + global.onProvisionalDestinationResolved =
|
| + this.onProvisionalDestinationResolved_.bind(this);
|
| + global.failedToResolveProvisionalDestination =
|
| + this.failedToResolveProvisionalDestination_.bind(this);
|
| };
|
|
|
| /**
|
| @@ -106,6 +110,8 @@ cr.define('print_preview', function() {
|
| EXTENSION_CAPABILITIES_SET:
|
| 'print_preview.NativeLayer.EXTENSION_CAPABILITIES_SET',
|
| PRINT_PRESET_OPTIONS: 'print_preview.NativeLayer.PRINT_PRESET_OPTIONS',
|
| + EXTENSION_USB_PRINTER_RESOLVED:
|
| + 'print_preview.NativeLayer.EXTENSION_USB_PRINTER_RESOLVED'
|
| };
|
|
|
| /**
|
| @@ -214,6 +220,17 @@ cr.define('print_preview', function() {
|
| },
|
|
|
| /**
|
| + * @param {string} provisionalDestinationId
|
| + * @param {string} extensionId
|
| + * @param {!number} usbId
|
| + */
|
| + grantUsbExtensionPermission:
|
| + function(provisionalDestinationId, extensionId, usbId) {
|
| + chrome.send('grantExtensionUsbPrinterAccess',
|
| + [provisionalDestinationId, extensionId, usbId]);
|
| + },
|
| +
|
| + /**
|
| * @param {!print_preview.Destination} destination Destination to print to.
|
| * @param {!print_preview.ticket_items.Color} color Color ticket item.
|
| * @return {number} Native layer color model.
|
| @@ -529,6 +546,23 @@ cr.define('print_preview', function() {
|
| this.dispatchEvent(getCapsFailEvent);
|
| },
|
|
|
| + failedToResolveProvisionalDestination_: function(provisionalDestinationId) {
|
| + var evt = new Event(
|
| + NativeLayer.EventType.EXTENSION_USB_PRINTER_RESOLVED);
|
| + evt.provisionalId = provisionalDestinationId;
|
| + evt.destination = null;
|
| + this.dispatchEvent(evt);
|
| + },
|
| +
|
| + onProvisionalDestinationResolved_: function(provisionalDestinationId,
|
| + destinationInfo) {
|
| + var evt = new Event(
|
| + NativeLayer.EventType.EXTENSION_USB_PRINTER_RESOLVED);
|
| + evt.provisionalId = provisionalDestinationId;
|
| + evt.destination = destinationInfo;
|
| + this.dispatchEvent(evt);
|
| + },
|
| +
|
| /**
|
| * Called when native layer gets settings information for a requested privet
|
| * destination.
|
|
|