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

Side by Side Diff: chrome/common/extensions/api/experimental_system_indicator.idl

Issue 11361189: Initial skeleton for System Indicator API (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add menu handling stubs, address formatting issues Created 8 years, 1 month 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
(Empty)
1 // Copyright (c) 2012 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.
4
5 // Manages an app's system indicator icon, an image displayed in the system's
6 // menubar, system tray, or other visible area provided by the OS.
7 namespace experimental.systemIndicator {
not at google - send to devlin 2012/11/14 19:53:20 We should avoid making APIs experimental, it compl
dewittj 2012/11/16 00:56:28 Fixed, now restricted to dev channel, but not expe
8 enum MenuItemType {separator, normal};
9
10 dictionary MenuDescription {
11 MenuItemNode [] nodes;
not at google - send to devlin 2012/11/14 19:53:20 For better or for worse, we already have an API fo
dewittj 2012/11/16 00:56:28 I removed the menuing APIs here and will add acces
12 };
13
14 dictionary MenuItemNode {
15 MenuItemType type;
16 DOMString id;
17 DOMString? title;
18 };
19
20 dictionary MenuItemClickInfo {
21 DOMString id;
22 };
23
24 interface Functions {
not at google - send to devlin 2012/11/14 19:53:20 This API looks very similar to the extension actio
dewittj 2012/11/16 00:56:28 I've changed the names and parameters to more clos
25 // Set the image to be used as an indicator icon, using a URL relative
26 // to the application root. This will only allow extension-local resources
27 // to be loaded, so that the offline app experience is better.
28 static void setIconURL(DOMString path);
not at google - send to devlin 2012/11/14 19:53:20 separating each of these methods with blank lines
dewittj 2012/11/16 00:56:28 New IDL has spaces
29 // Set the image to be used as an indicator icon, using a set of ImageData
30 // objects. These objects should have multiple resolutions so that an
31 // appropriate size can be selected for the given icon size and DPI scaling
32 // settings. Only square ImageData objects will be accepted.
33 static void setIconData([instanceOf=ImageData] object [] images);
34 // Set the list of menu items to be displayed when the user interacts with
35 // the indicator icon. Use an empty list to disable the menu, sending
36 // click events for both mouse buttons.
37 static void setMenu(MenuDescription menu);
38
39 // Show the icon in the status tray.
40 static void show();
41 // Hide the icon from the status tray.
42 static void hide();
43 };
44
45 interface Events {
46 // fired only when a click on the icon does not result in a menu being
jianli 2012/11/14 19:27:41 nit: capitalize "fired"
dewittj 2012/11/16 00:56:28 Fixed.
47 // shown.
not at google - send to devlin 2012/11/14 19:53:20 It's confusing to me that we have onClicked meanin
dewittj 2012/11/16 00:56:28 I think that the confusion is actually in when thi
not at google - send to devlin 2012/11/16 17:42:04 Yep that's exactly what I meant.
48 static void onClicked();
49 // Which button fires a click event is system-dependent and will reflect
50 // the most common behavior of icons found in native applications.
51 static void onMenuClicked(MenuItemClickInfo item);
52 };
53 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698