// 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();
  };
};
