Index: chrome/common/extensions/api/experimental_notification.idl |
diff --git a/chrome/common/extensions/api/experimental_notification.idl b/chrome/common/extensions/api/experimental_notification.idl |
index 4ef290f096d76b87cc2c13d308f5f147f90d4f9f..7cc6ec2c1b6d27625ce40b67ae600c652e8e27ed 100644 |
--- a/chrome/common/extensions/api/experimental_notification.idl |
+++ b/chrome/common/extensions/api/experimental_notification.idl |
@@ -65,6 +65,10 @@ |
// Items for multi-item notifications. |
NotificationItem[]? items; |
+ |
+ // Object specifying user data for the notification. Values that cannot be |
+ // serialized (functions, etc) will be ignored. |
+ object? userData; |
}; |
callback CreateCallback = void (DOMString notificationId); |
@@ -73,6 +77,14 @@ |
callback ClearCallback = void (boolean wasCleared); |
+ // |useData| is NotificationOptions.userData that was passed to create/update |
+ // call, if was specified, null otherwise. |
+ callback GetCallback = void (object userData); |
+ |
+ // |notifications| is a map from all notifications IDs of all notifications |
+ // to their userData objects, if were specified, otherwise, nulls. |
+ callback GetAllCallback = void (object notifications); |
+ |
interface Functions { |
// Creates and displays a notification having the contents in |options|, |
// identified by the id |notificationId|. If |notificationId| is empty, |
@@ -95,6 +107,14 @@ |
// corresponding notification. |callback| indicates whether a matching |
// notification existed. |
static void clear(DOMString notificationId, ClearCallback callback); |
+ |
+ static void clearAll(); |
+ |
+ static void get(DOMString notificationId, GetCallback callback); |
+ |
+ // Returns to |callback| ids and user data of all locally created |
+ // notifications. |
+ static void getAll(GetAllCallback callback); |
}; |
interface Events { |
@@ -104,13 +124,18 @@ |
static void onDisplayed(DOMString notificationId); |
// The notification closed, either by the system or by user action. |
- static void onClosed(DOMString notificationId, boolean byUser); |
+ static void onClosed(DOMString notificationId, |
+ boolean byUser, |
+ object userData); |
// The user clicked in a non-button area of the notification. |
- static void onClicked(DOMString notificationId); |
+ static void onClicked(DOMString notificationId, |
+ object userData); |
// The user pressed a button in the notification. |
- static void onButtonClicked(DOMString notificationId, long buttonIndex); |
+ static void onButtonClicked(DOMString notificationId, |
+ long buttonIndex, |
+ object userData); |
}; |
}; |