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

Unified Diff: chrome/browser/renderer_host/render_view_host.cc

Issue 271052: Browser side support (sans UI) for desktop notifications.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 2 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/browser/renderer_host/render_view_host.cc
===================================================================
--- chrome/browser/renderer_host/render_view_host.cc (revision 28695)
+++ chrome/browser/renderer_host/render_view_host.cc (working copy)
@@ -20,6 +20,7 @@
#include "chrome/browser/dom_operation_notification_details.h"
#include "chrome/browser/extensions/extension_message_service.h"
#include "chrome/browser/metrics/user_metrics.h"
+#include "chrome/browser/notifications/desktop_notification_service.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/renderer_host/render_process_host.h"
#include "chrome/browser/renderer_host/render_view_host_delegate.h"
@@ -833,6 +834,12 @@
OnQueryFormFieldAutofill)
IPC_MESSAGE_HANDLER(ViewHostMsg_RemoveAutofillEntry,
OnRemoveAutofillEntry)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_ShowDesktopNotification,
+ OnShowDesktopNotification)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_ShowDesktopNotificationText,
+ OnShowDesktopNotificationText)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_RequestNotificationPermission,
+ OnRequestNotificationPermission)
IPC_MESSAGE_HANDLER(ViewHostMsg_ExtensionRequest, OnExtensionRequest)
IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionChanged, OnMsgSelectionChanged)
IPC_MESSAGE_HANDLER(ViewHostMsg_ExtensionPostMessage,
@@ -1644,6 +1651,32 @@
target));
}
+void RenderViewHost::OnShowDesktopNotification(const GURL& source_origin,
+ const GURL& url, int notification_id) {
+ DesktopNotificationService* service =
+ process()->profile()->GetDesktopNotificationService();
+ service->ShowDesktopNotification(source_origin, url, process()->id(),
+ routing_id(), DesktopNotificationService::PageNotification,
+ notification_id);
+}
+
+void RenderViewHost::OnShowDesktopNotificationText(const GURL& source_origin,
+ const GURL& icon, const string16& title, const string16& text,
+ int notification_id) {
+ DesktopNotificationService* service =
+ process()->profile()->GetDesktopNotificationService();
+ service->ShowDesktopNotificationText(source_origin, icon, title, text,
+ process()->id(), routing_id(),
+ DesktopNotificationService::PageNotification, notification_id);
+}
+
+void RenderViewHost::OnRequestNotificationPermission(
+ const GURL& source_origin, int callback_context) {
+ DesktopNotificationService* service =
+ process()->profile()->GetDesktopNotificationService();
+ service->RequestPermission(source_origin, callback_context);
+}
+
void RenderViewHost::OnExtensionRequest(const std::string& name,
const ListValue& args_holder,
int request_id,
« no previous file with comments | « chrome/browser/renderer_host/render_view_host.h ('k') | chrome/browser/renderer_host/resource_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698