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

Unified Diff: chrome/browser/renderer_host/resource_message_filter.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
« no previous file with comments | « chrome/browser/renderer_host/resource_message_filter.h ('k') | chrome/browser/resources/notification.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/resource_message_filter.cc
===================================================================
--- chrome/browser/renderer_host/resource_message_filter.cc (revision 28695)
+++ chrome/browser/renderer_host/resource_message_filter.cc (working copy)
@@ -19,6 +19,8 @@
#include "chrome/browser/nacl_process_host.h"
#include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/browser/net/dns_global.h"
+#include "chrome/browser/notifications/desktop_notification_service.h"
+#include "chrome/browser/notifications/notifications_prefs_cache.h"
#include "chrome/browser/plugin_service.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/privacy_blacklist/blacklist.h"
@@ -167,6 +169,8 @@
resource_dispatcher_host->webkit_thread()))),
ALLOW_THIS_IN_INITIALIZER_LIST(db_dispatcher_host_(
new DatabaseDispatcherHost(profile->GetPath(), this))),
+ notification_prefs_(
+ profile->GetDesktopNotificationService()->prefs_cache()),
off_the_record_(profile->IsOffTheRecord()),
next_route_id_callback_(NewCallbackWithReturnValue(
render_widget_helper, &RenderWidgetHelper::GetNextRoutingID)) {
@@ -335,6 +339,8 @@
IPC_MESSAGE_HANDLER(ViewHostMsg_ClipboardFindPboardWriteStringAsync,
OnClipboardFindPboardWriteString)
#endif
+ IPC_MESSAGE_HANDLER(ViewHostMsg_CheckNotificationPermission,
+ OnCheckNotificationPermission)
IPC_MESSAGE_HANDLER(ViewHostMsg_GetMimeTypeFromExtension,
OnGetMimeTypeFromExtension)
IPC_MESSAGE_HANDLER(ViewHostMsg_GetMimeTypeFromFile,
@@ -690,6 +696,11 @@
#endif
+void ResourceMessageFilter::OnCheckNotificationPermission(
+ const GURL& source_origin, int* result) {
+ *result = notification_prefs_->HasPermission(source_origin);
+}
+
void ResourceMessageFilter::OnGetMimeTypeFromExtension(
const FilePath::StringType& ext, std::string* mime_type) {
net::GetMimeTypeFromExtension(ext, mime_type);
« no previous file with comments | « chrome/browser/renderer_host/resource_message_filter.h ('k') | chrome/browser/resources/notification.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698