OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 // TODO(tbarzic): Implement this. | 5 /** @const {number} */ |
| 6 var APP_WINDOW_WIDTH = 735; |
| 7 |
| 8 /** @const {number} */ |
| 9 var APP_WINDOW_HEIGHT = 530; |
| 10 |
| 11 chrome.webstoreWidgetPrivate.onShowWidget.addListener(function(options) { |
| 12 if (!options || options.type != 'PRINTER_PROVIDER' || !options.usbId) { |
| 13 console.error('Invalid widget options.'); |
| 14 return; |
| 15 } |
| 16 |
| 17 chrome.app.window.create('app/main.html', { |
| 18 id: JSON.stringify(options), |
| 19 frame: 'none', |
| 20 innerBounds: {width: APP_WINDOW_WIDTH, height: APP_WINDOW_HEIGHT}, |
| 21 resizable: false |
| 22 }, function(createdWindow) { |
| 23 createdWindow.contentWindow.params = { |
| 24 filter: { |
| 25 'printer_provider_vendor_id': options.usbId.vendorId, |
| 26 'printer_provider_product_id': options.usbId.productId |
| 27 }, |
| 28 webstoreUrl: null |
| 29 }; |
| 30 }); |
| 31 }); |
OLD | NEW |