Chromium Code Reviews| Index: chrome/common/extensions/api/experimental_system_indicator.idl |
| diff --git a/chrome/common/extensions/api/experimental_system_indicator.idl b/chrome/common/extensions/api/experimental_system_indicator.idl |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..37c65d42759c8f3cf7c9749ef3053fef8279443a |
| --- /dev/null |
| +++ b/chrome/common/extensions/api/experimental_system_indicator.idl |
| @@ -0,0 +1,53 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +// Manages an app's system indicator icon, an image displayed in the system's |
| +// menubar, system tray, or other visible area provided by the OS. |
| +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
|
| + enum MenuItemType {separator, normal}; |
| + |
| + dictionary MenuDescription { |
| + 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
|
| + }; |
| + |
| + dictionary MenuItemNode { |
| + MenuItemType type; |
| + DOMString id; |
| + DOMString? title; |
| + }; |
| + |
| + dictionary MenuItemClickInfo { |
| + DOMString id; |
| + }; |
| + |
| + 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
|
| + // Set the image to be used as an indicator icon, using a URL relative |
| + // to the application root. This will only allow extension-local resources |
| + // to be loaded, so that the offline app experience is better. |
| + 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
|
| + // Set the image to be used as an indicator icon, using a set of ImageData |
| + // objects. These objects should have multiple resolutions so that an |
| + // appropriate size can be selected for the given icon size and DPI scaling |
| + // settings. Only square ImageData objects will be accepted. |
| + static void setIconData([instanceOf=ImageData] object [] images); |
| + // Set the list of menu items to be displayed when the user interacts with |
| + // the indicator icon. Use an empty list to disable the menu, sending |
| + // click events for both mouse buttons. |
| + static void setMenu(MenuDescription menu); |
| + |
| + // Show the icon in the status tray. |
| + static void show(); |
| + // Hide the icon from the status tray. |
| + static void hide(); |
| + }; |
| + |
| + interface Events { |
| + // 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.
|
| + // 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.
|
| + static void onClicked(); |
| + // Which button fires a click event is system-dependent and will reflect |
| + // the most common behavior of icons found in native applications. |
| + static void onMenuClicked(MenuItemClickInfo item); |
| + }; |
| +}; |