Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(439)

Side by Side Diff: components/chrome_apps/webstore_widget/app/background.js

Issue 1123373003: Launch webstore widget app when unsupported printer is plugged in (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_cws_widget_scripts
Patch Set: bump app version Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698