Implement cancel() API on a Notification object so that script can cancel or tear down a toast.
BUG=26360
TEST=cancel a notification
Review URL: http://codereview.chromium.org/363003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31004 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/notifications/notification_object_proxy.h b/chrome/browser/notifications/notification_object_proxy.h
index 168bd8a0..a5ad53b43 100644
--- a/chrome/browser/notifications/notification_object_proxy.h
+++ b/chrome/browser/notifications/notification_object_proxy.h
@@ -31,9 +31,17 @@
void Error();
// To be called when the desktop notification is closed. If closed by a
- // user explicitly (as opposed to timeout), |by_user| should be true.
+ // user explicitly (as opposed to timeout/script), |by_user| should be true.
void Close(bool by_user);
+ // Compares two proxies by ids to decide if they are equal.
+ bool IsSame(const NotificationObjectProxy& other) const {
+ return (notification_id_ == other.notification_id_ &&
+ route_id_ == other.route_id_ &&
+ process_id_ == other.process_id_ &&
+ worker_ == other.worker_);
+ }
+
private:
// Called on UI thread to schedule a message for sending.
void DeliverMessage(IPC::Message* message);