blob: e04df524d04b2c40c1458a3151143fdff77de276 [file] [log] [blame]
// 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.
// This is a private API since M23. This will be superceded by the
// systeminfo.storage API in the future.
// See http://crbug.com/166950 and http://crbug.com/177605.
namespace mediaGalleriesPrivate {
// A dictionary that describes an attached device.
[inline_doc] dictionary DeviceAttachmentDetails {
// The name of the device.
DOMString deviceName;
// A transient id that unique identifies the device.
DOMString deviceId;
};
// A dictionary that describes a detached device.
[inline_doc] dictionary DeviceDetachmentDetails {
// A transient id that unique identifies the device.
DOMString deviceId;
};
// A dictionary that describes the modified gallery.
[inline_doc] dictionary GalleryChangeDetails {
// Gallery identifier.
DOMString galleryId;
};
interface Events {
// Fired when a media device gets attached.
static void onDeviceAttached(DeviceAttachmentDetails details);
// Fired when a media device gets detached.
static void onDeviceDetached(DeviceDetachmentDetails details);
// Fired when a media gallery is changed.
static void onGalleryChanged(GalleryChangeDetails details);
};
// A dictionary that describes the add gallery watch request results.
dictionary AddGalleryWatchResult {
DOMString galleryId;
boolean success;
};
callback AddGalleryWatchCallback = void (AddGalleryWatchResult result);
callback GetAllGalleryWatchCallback = void (DOMString[] galleryIds);
// A dictionary that describes a media galleries handler.
[inline_doc] dictionary MediaGalleriesHandler {
// Unique action id per extension.
DOMString id;
// ID of the extension handling this handler.
DOMString extensionId;
// Localized title describing the action.
DOMString title;
// Url of the icon.
DOMString iconUrl;
};
callback GetHandlersCallback = void (MediaGalleriesHandler[] handlers);
interface Functions {
static void addGalleryWatch(DOMString galleryId,
AddGalleryWatchCallback callback);
static void removeGalleryWatch(DOMString galleryId);
static void getAllGalleryWatch(GetAllGalleryWatchCallback callback);
static void removeAllGalleryWatch();
static void getHandlers(GetHandlersCallback callback);
};
};