| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 // Manages an app's system indicator icon, an image displayed in the system's | 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. | 6 // menubar, system tray, or other visible area provided by the OS. |
| 7 // This is modelled after the other extension action APIs, such as | 7 // This is modelled after the other extension action APIs, such as |
| 8 // chrome.browserAction and chrome.pageAction. | 8 // chrome.browserAction and chrome.pageAction. |
| 9 [use_movable_types=true] namespace systemIndicator { | 9 namespace systemIndicator { |
| 10 dictionary SetIconDetails { | 10 dictionary SetIconDetails { |
| 11 any? path; | 11 any? path; |
| 12 any? imageData; | 12 any? imageData; |
| 13 }; | 13 }; |
| 14 | 14 |
| 15 callback DoneCallback = void (); | 15 callback DoneCallback = void (); |
| 16 | 16 |
| 17 interface Functions { | 17 interface Functions { |
| 18 // Set the image to be used as an indicator icon, using a set of ImageData | 18 // Set the image to be used as an indicator icon, using a set of ImageData |
| 19 // objects. These objects should have multiple resolutions so that an | 19 // objects. These objects should have multiple resolutions so that an |
| 20 // appropriate size can be selected for the given icon size and DPI scaling | 20 // appropriate size can be selected for the given icon size and DPI scaling |
| 21 // settings. Only square ImageData objects are accepted. | 21 // settings. Only square ImageData objects are accepted. |
| 22 static void setIcon(SetIconDetails details, optional DoneCallback callback); | 22 static void setIcon(SetIconDetails details, optional DoneCallback callback); |
| 23 | 23 |
| 24 // Show the icon in the status tray. | 24 // Show the icon in the status tray. |
| 25 static void enable(); | 25 static void enable(); |
| 26 | 26 |
| 27 // Hide the icon from the status tray. | 27 // Hide the icon from the status tray. |
| 28 static void disable(); | 28 static void disable(); |
| 29 }; | 29 }; |
| 30 | 30 |
| 31 interface Events { | 31 interface Events { |
| 32 // Fired only when a click on the icon does not result in a menu being | 32 // Fired only when a click on the icon does not result in a menu being |
| 33 // shown. | 33 // shown. |
| 34 static void onClicked(); | 34 static void onClicked(); |
| 35 }; | 35 }; |
| 36 }; | 36 }; |
| OLD | NEW |