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/renderer_host | |
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/renderer_host')
-rw-r--r-- | chrome/browser/renderer_host/render_view_host.cc | 9 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_view_host.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc index 5c5b120..a2749a7 100644 --- a/chrome/browser/renderer_host/render_view_host.cc +++ b/chrome/browser/renderer_host/render_view_host.cc @@ -831,6 +831,8 @@ void RenderViewHost::OnMessageReceived(const IPC::Message& msg) { OnShowDesktopNotification) IPC_MESSAGE_HANDLER(ViewHostMsg_ShowDesktopNotificationText, OnShowDesktopNotificationText) + IPC_MESSAGE_HANDLER(ViewHostMsg_CancelDesktopNotification, + OnCancelDesktopNotification) IPC_MESSAGE_HANDLER(ViewHostMsg_RequestNotificationPermission, OnRequestNotificationPermission) IPC_MESSAGE_HANDLER(ViewHostMsg_ExtensionRequest, OnExtensionRequest) @@ -1677,6 +1679,13 @@ void RenderViewHost::OnShowDesktopNotificationText(const GURL& source_origin, DesktopNotificationService::PageNotification, notification_id); } +void RenderViewHost::OnCancelDesktopNotification(int notification_id) { + DesktopNotificationService* service= + process()->profile()->GetDesktopNotificationService(); + service->CancelDesktopNotification( + process()->id(), routing_id(), notification_id); +} + void RenderViewHost::OnRequestNotificationPermission( const GURL& source_origin, int callback_context) { DesktopNotificationService* service = diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h index 6d1dfc8..7d9337f 100644 --- a/chrome/browser/renderer_host/render_view_host.h +++ b/chrome/browser/renderer_host/render_view_host.h @@ -585,6 +585,7 @@ class RenderViewHost : public RenderWidgetHost, const string16& title, const string16& text, int notification_id); + void OnCancelDesktopNotification(int notification_id); void OnRequestNotificationPermission(const GURL& origin, int callback_id); void OnExtensionRequest(const std::string& name, const ListValue& args, |