| Index: third_party/chrome/idl/experimental_notification.idl
|
| diff --git a/third_party/chrome/idl/experimental_notification.idl b/third_party/chrome/idl/experimental_notification.idl
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..1af49c245d3f7cb84bc70036782bd0c346254946
|
| --- /dev/null
|
| +++ b/third_party/chrome/idl/experimental_notification.idl
|
| @@ -0,0 +1,111 @@
|
| +// Copyright (c) 2013 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.
|
| +
|
| +[nodoc] namespace experimental.notification {
|
| + dictionary NotificationItem {
|
| + // Title of one item of a list notification.
|
| + DOMString title;
|
| +
|
| + // Additional details about this item.
|
| + DOMString message;
|
| + };
|
| +
|
| + dictionary NotificationOptions {
|
| + // Which type of notification to display.
|
| + //
|
| + // simple: icon, title, message
|
| + // basic: our MVP, with two buttons, expanded text, etc. TEMPORARY!
|
| + DOMString type;
|
| +
|
| + // Sender's avatar, app icon, or a thumbnail for image notifications.
|
| + DOMString iconUrl;
|
| +
|
| + // Title of the notification (e.g. sender name for email).
|
| + DOMString title;
|
| +
|
| + // Main notification content.
|
| + DOMString message;
|
| +
|
| + // Priority ranges from -2 to 2. -2 is lowest priority. 2 is highest. Zero
|
| + // is default.
|
| + long? priority;
|
| +
|
| + // A timestamp associated with the notification. An example is
|
| + // "Tue, 15 Nov 1994 12:45:26 GMT". Note that RFC822 doesn't specify the
|
| + // timezone label "UTC." To specify UTC, use "GMT" instead.
|
| + DOMString? timestamp;
|
| +
|
| + // Smaller version of the icon.
|
| + DOMString? secondIconUrl;
|
| +
|
| + // A number, controlled entirely by the caller, that is intended to
|
| + // summarize the number of outstanding notifications. TODO(miket) what does
|
| + // that mean?
|
| + long? unreadCount;
|
| +
|
| + // Text and icon of the first button in the notification.
|
| + DOMString? buttonOneTitle;
|
| + DOMString? buttonOneIconUrl;
|
| +
|
| + // Text and icon of the second button in the notification.
|
| + DOMString? buttonTwoTitle;
|
| + DOMString? buttonTwoIconUrl;
|
| +
|
| + // Secondary notification content.
|
| + DOMString? expandedMessage;
|
| +
|
| + // Image thumbnail for image-type notifications
|
| + DOMString? imageUrl;
|
| +
|
| + // Items for multi-item notifications.
|
| + NotificationItem[]? items;
|
| + };
|
| +
|
| + callback CreateCallback = void (DOMString notificationId);
|
| +
|
| + callback UpdateCallback = void (boolean wasUpdated);
|
| +
|
| + callback DeleteCallback = void (boolean wasDeleted);
|
| +
|
| + interface Functions {
|
| + // Creates and displays a notification having the contents in |options|,
|
| + // identified by the id |notificationId|. If |notificationId| is empty,
|
| + // |create| generates an id. |callback| returns the notification id (either
|
| + // supplied or generated) that represents the created notification.
|
| + static void create(DOMString notificationId,
|
| + NotificationOptions options,
|
| + CreateCallback callback);
|
| +
|
| + // Updates an existing notification having the id |notificationId| and the
|
| + // options |options|. |callback| indicates whether a matching notification
|
| + // existed.
|
| + static void update(DOMString notificationId,
|
| + NotificationOptions options,
|
| + UpdateCallback callback);
|
| +
|
| + // Given a |notificationId| returned by the |create| method, deletes the
|
| + // corresponding notification. |callback| indicates whether a matching
|
| + // notification existed.
|
| + static void delete(DOMString notificationId, DeleteCallback callback);
|
| + };
|
| +
|
| + interface Events {
|
| + // The system displayed the notification.
|
| + static void onDisplayed(DOMString notificationId);
|
| +
|
| + // An error occurred. TODO(miket): which errors can happen, and when? In
|
| + // which form (string, ID) should we describe the error?
|
| + static void onError(DOMString notificationId);
|
| +
|
| + // The notification closed, either by the system or by user action.
|
| + static void onClosed(DOMString notificationId, boolean byUser);
|
| +
|
| + // The user clicked in a non-button area of the notification.
|
| + static void onClicked(DOMString notificationId);
|
| +
|
| + // The user pressed a button in the notification.
|
| + static void onButtonClicked(DOMString notificationId, long buttonIndex);
|
| + };
|
| +
|
| +};
|
|
|