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

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

Issue 855813002: Mark create/update/clear callbacks of notification API as optional (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments #25 Created 5 years, 11 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
Index: chrome/common/extensions/api/notifications.idl
diff --git a/chrome/common/extensions/api/notifications.idl b/chrome/common/extensions/api/notifications.idl
index fb1fe65b98977bd6430b043c8f92f0af55287492..7b416053fad2a2ca82ea8186f847b971c0297304 100644
--- a/chrome/common/extensions/api/notifications.idl
+++ b/chrome/common/extensions/api/notifications.idl
@@ -124,31 +124,40 @@ namespace notifications {
interface Functions {
// Creates and displays a notification.
- // |notificationId|: Identifier of the notification. If it is empty, this
- // method generates an id. If it matches an existing notification, this
- // method first clears that notification before proceeding with the create
- // operation.
+ // |notificationId|: Identifier of the notification. If not set or empty, an
+ // ID will automatically be generated. If it matches an existing
+ // notification, this method first clears that notification before
+ // proceeding with the create operation.
+ //
+ // The <code>notificationId</code> parameter is required before Chrome 42.
// |options|: Contents of the notification.
// |callback|: Returns the notification id (either supplied or generated)
// that represents the created notification.
- static void create(DOMString notificationId,
+ //
+ // The callback is required before Chrome 42.
+ static void create(optional DOMString notificationId,
NotificationOptions options,
- CreateCallback callback);
+ optional CreateCallback callback);
// Updates an existing notification.
// |notificationId|: The id of the notification to be updated. This is
// returned by $(ref:notifications.create) method.
// |options|: Contents of the notification to update to.
// |callback|: Called to indicate whether a matching notification existed.
+ //
+ // The callback is required before Chrome 42.
static void update(DOMString notificationId,
NotificationOptions options,
- UpdateCallback callback);
+ optional UpdateCallback callback);
// Clears the specified notification.
// |notificationId|: The id of the notification to be cleared. This is
// returned by $(ref:notifications.create) method.
// |callback|: Called to indicate whether a matching notification existed.
- static void clear(DOMString notificationId, ClearCallback callback);
+ //
+ // The callback is required before Chrome 42.
+ static void clear(DOMString notificationId,
+ optional ClearCallback callback);
// Retrieves all the notifications.
// |callback|: Returns the set of notification_ids currently in the system.

Powered by Google App Engine
This is Rietveld 408576698