summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/api/system_indicator.idl
blob: c24f8142efccd35cc051c99335244291b7c1878c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// 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.
// This is modelled after the other extension action APIs, such as
// chrome.browserAction and chrome.pageAction.
namespace systemIndicator {
  dictionary SetIconDetails {
    any? path;
    any? imageData;
  };

  callback DoneCallback = void ();

  interface Functions {
    // 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 are accepted.
    static void setIcon(SetIconDetails details, optional DoneCallback callback);

    // Show the icon in the status tray.
    static void enable();

    // Hide the icon from the status tray.
    static void disable();
  };

  interface Events {
    // Fired only when a click on the icon does not result in a menu being
    // shown.
    static void onClicked();
  };
};