1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
6 var APP_WINDOW_WIDTH
= 735;
9 var APP_WINDOW_HEIGHT
= 530;
11 chrome
.webstoreWidgetPrivate
.onShowWidget
.addListener(function(options
) {
12 if (!options
|| options
.type
!= 'PRINTER_PROVIDER' || !options
.usbId
) {
13 console
.error('Invalid widget options.');
17 chrome
.app
.window
.create('app/main.html', {
18 id
: JSON
.stringify(options
),
20 innerBounds
: {width
: APP_WINDOW_WIDTH
, height
: APP_WINDOW_HEIGHT
},
22 }, function(createdWindow
) {
23 createdWindow
.contentWindow
.params
= {
25 'printer_provider_vendor_id': options
.usbId
.vendorId
,
26 'printer_provider_product_id': options
.usbId
.productId