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 // This is modelled after the other extension action APIs, such as 8 // chrome.browserAction and chrome.pageAction. 9 namespace systemIndicator { 10 dictionary SetIconDetails { 11 any? path; 12 any? imageData; 13 }; 14 15 callback DoneCallback = void (); 16 17 interface Functions { 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 20 // appropriate size can be selected for the given icon size and DPI scaling 21 // settings. Only square ImageData objects are accepted. 22 static void setIcon(SetIconDetails details, optional DoneCallback callback); 23 24 // Show the icon in the status tray. 25 static void enable(); 26 27 // Hide the icon from the status tray. 28 static void disable(); 29 }; 30 31 interface Events { 32 // Fired only when a click on the icon does not result in a menu being 33 // shown. 34 static void onClicked(); 35 }; 36 }; 37