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

Unified Diff: content/browser/renderer_host/render_message_filter.cc

Issue 7053041: Add a Create method to DesktopNotificationHandler and stubs for the notification objects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 6 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 | « content/browser/renderer_host/render_message_filter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_message_filter.cc
diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc
index e82efdcc3b8f681b5d649fcf4f54d51d628d6bff..83385fc349e6b534b1a629fa531a95dd716fc01b 100644
--- a/content/browser/renderer_host/render_message_filter.cc
+++ b/content/browser/renderer_host/render_message_filter.cc
@@ -18,7 +18,6 @@
#include "chrome/browser/extensions/extension_info_map.h"
#include "chrome/browser/notifications/desktop_notification_service.h"
#include "chrome/browser/notifications/desktop_notification_service_factory.h"
-#include "chrome/browser/notifications/notifications_prefs_cache.h"
jam 2011/06/06 21:16:22 woohoo! please take out this file from content\br
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension.h"
@@ -285,14 +284,14 @@ RenderMessageFilter::RenderMessageFilter(
resource_context_(profile->GetResourceContext()),
extensions_request_context_(profile->GetRequestContextForExtensions()),
render_widget_helper_(render_widget_helper),
- notification_prefs_(
- DesktopNotificationServiceFactory::GetForProfile(profile)->
- prefs_cache()),
+ notification_service_(
+ DesktopNotificationServiceFactory::GetForProfile(profile)),
incognito_(profile->IsOffTheRecord()),
webkit_context_(profile->GetWebKitContext()),
render_process_id_(render_process_id) {
DCHECK(request_context_);
+ profile_->GetPrefs();
render_widget_helper_->Init(render_process_id_, resource_dispatcher_host_);
}
@@ -627,7 +626,9 @@ void RenderMessageFilter::OnCheckNotificationPermission(
// Fall back to the regular notification preferences, which works on an
// origin basis.
- *result = notification_prefs_->HasPermission(source_url.GetOrigin());
+ *result = notification_service_ ?
+ notification_service_->HasPermission(source_url.GetOrigin()) :
+ WebKit::WebNotificationPresenter::PermissionNotAllowed;
}
void RenderMessageFilter::OnAllocateSharedMemoryBuffer(
« no previous file with comments | « content/browser/renderer_host/render_message_filter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698