Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / common / extensions / api / webstore_widget_private.idl
blob362f37c50fe5fe97bc1c6057da71273b191d39b5
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 // webstoreWidgetPrivate API.
6 // This is a private API used by the Chrome Webstore widget app on Chrome OS.
7 [platforms=("chromeos")]
8 namespace webstoreWidgetPrivate {
9 // The type of apps that should be shown in the Webstore widget.
10 enum Type {
11 // Type that should be used to list printer provider apps. For this type,
12 // options passed to |onShowWidget| should have |usbId| property set.
13 PRINTER_PROVIDER
16 // ID for a USB device.
17 dictionary UsbId {
18 // The USB device's vendor ID property.
19 long vendorId;
21 // The USB device's product ID property.
22 long productId;
25 // Filter for apps that will be shown in the Webstore widget.
26 dictionary Options {
27 // The type of apps that should be shown.
28 Type type;
30 // If set, only apps that have printerProvider permission and usbDevices
31 // permission for USB device with the provided (vendor ID, product ID) pair.
32 // Required if |type| is set to |PRINTER_PROVIDER|.
33 UsbId? usbId;
36 // |result| Object containing the string assets.
37 callback GetStringsCallback = void(object result);
39 // Callback that does not take arguments.
40 callback SimpleCallback = void();
42 interface Functions {
43 // Gets localized strings and initialization data.
44 static void getStrings(GetStringsCallback callback);
46 // Requests to install a webstore item.
47 // |item_id| The id of the item to install.
48 // |silentInstallation| False to show installation prompt. True not to show.
49 // Can be set to true only for a subset of installation requests.
50 static void installWebstoreItem(DOMString itemId,
51 boolean silentInstallation,
52 SimpleCallback callback);
55 interface Events {
56 // Event dispatched when a Chrome Webstore widget is requested to be shown.
57 // |options|: Options describing the set of apps that should be shown in the
58 // widget.
59 static void onShowWidget(Options options);