Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(566)

Unified Diff: chrome/common/extensions/api/experimental_notification.idl

Issue 12334047: Adding user data to the notification options. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding clearAll/get/getAll Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698