Reland "Non-SFI mode: Switch to newlib. (patchset #4 id:60001 of https://codereview...
[chromium-blink-merge.git] / components / chrome_apps / webstore_widget / app / background.js
blob42534ee874a2559b31aba8553ecb4ceb92d7c683
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.
5 /** @const {number} */
6 var APP_WINDOW_WIDTH = 735;
8 /** @const {number} */
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.');
14 return;
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
28 webstoreUrl: null
30 });
31 });