diff options
author | johnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-04 21:29:11 +0000 |
---|---|---|
committer | johnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-04 21:29:11 +0000 |
commit | b52448bbb0eef4eee4cc025562cd04b1c7d530ef (patch) | |
tree | e57c73e0f1cc2ace36357bbef0594ad12addd070 /chrome/browser/notifications/desktop_notification_service.cc | |
parent | 48af406a5dc13be98bfef6c902843875399f1033 (diff) | |
download | chromium_src-b52448bbb0eef4eee4cc025562cd04b1c7d530ef.zip chromium_src-b52448bbb0eef4eee4cc025562cd04b1c7d530ef.tar.gz chromium_src-b52448bbb0eef4eee4cc025562cd04b1c7d530ef.tar.bz2 |
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
Diffstat (limited to 'chrome/browser/notifications/desktop_notification_service.cc')
-rw-r--r-- | chrome/browser/notifications/desktop_notification_service.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/chrome/browser/notifications/desktop_notification_service.cc b/chrome/browser/notifications/desktop_notification_service.cc index 1cd0b31..477b505 100644 --- a/chrome/browser/notifications/desktop_notification_service.cc +++ b/chrome/browser/notifications/desktop_notification_service.cc @@ -267,6 +267,16 @@ void DesktopNotificationService::ShowNotification( ui_manager_->Add(notification, profile_); } +bool DesktopNotificationService::CancelDesktopNotification( + int process_id, int route_id, int notification_id) { + scoped_refptr<NotificationObjectProxy> proxy( + new NotificationObjectProxy(process_id, route_id, notification_id, + false)); + Notification notif(GURL(), GURL(), proxy); + return ui_manager_->Cancel(notif); +} + + bool DesktopNotificationService::ShowDesktopNotification( const GURL& origin, const GURL& url, int process_id, int route_id, NotificationSource source, int notification_id) { |