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

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

Issue 7125006: Get rid of Chrome notifications dependency, and instead go through ContentBrowserClient to show U... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix browsertest 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
Index: content/browser/renderer_host/render_message_filter.cc
===================================================================
--- content/browser/renderer_host/render_message_filter.cc (revision 88079)
+++ content/browser/renderer_host/render_message_filter.cc (working copy)
@@ -16,8 +16,6 @@
#include "chrome/browser/download/download_types.h"
#include "chrome/browser/download/download_util.h"
#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/profiles/profile.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension.h"
@@ -284,8 +282,6 @@
resource_context_(profile->GetResourceContext()),
extensions_request_context_(profile->GetRequestContextForExtensions()),
render_widget_helper_(render_widget_helper),
- notification_service_(
- DesktopNotificationServiceFactory::GetForProfile(profile)),
incognito_(profile->IsOffTheRecord()),
webkit_context_(profile->GetWebKitContext()),
render_process_id_(render_process_id) {
@@ -614,21 +610,8 @@
void RenderMessageFilter::OnCheckNotificationPermission(
const GURL& source_url, int* result) {
- *result = WebKit::WebNotificationPresenter::PermissionNotAllowed;
-
- const Extension* extension =
- extension_info_map_->extensions().GetByURL(source_url);
- if (extension &&
- extension->HasApiPermission(Extension::kNotificationPermission)) {
- *result = WebKit::WebNotificationPresenter::PermissionAllowed;
- return;
- }
-
- // Fall back to the regular notification preferences, which works on an
- // origin basis.
- *result = notification_service_ ?
- notification_service_->HasPermission(source_url.GetOrigin()) :
- WebKit::WebNotificationPresenter::PermissionNotAllowed;
+ *result = content::GetContentClient()->browser()->
+ CheckDesktopNotificationPermission(source_url, resource_context_);
}
void RenderMessageFilter::OnAllocateSharedMemoryBuffer(

Powered by Google App Engine
This is Rietveld 408576698