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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 578883003: Remove the strict dependency on WebContents for Web Notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: plumb through render_process_id Created 6 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/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 0ab93b3e5711dab3b2afa28c8c0f3f9a37d6c9c1..38432bd255fccb12d9e4c1d7dab8be018810d85c 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -1900,17 +1900,20 @@ ChromeContentBrowserClient::CheckDesktopNotificationPermission(
void ChromeContentBrowserClient::ShowDesktopNotification(
const content::ShowDesktopNotificationHostMsgParams& params,
- RenderFrameHost* render_frame_host,
+ content::BrowserContext* browser_context,
+ int render_process_id,
scoped_ptr<content::DesktopNotificationDelegate> delegate,
base::Closure* cancel_callback) {
#if defined(ENABLE_NOTIFICATIONS)
- content::RenderProcessHost* process = render_frame_host->GetProcess();
- Profile* profile = Profile::FromBrowserContext(process->GetBrowserContext());
+ Profile* profile = Profile::FromBrowserContext(browser_context);
+ DCHECK(profile);
+
DesktopNotificationService* service =
DesktopNotificationServiceFactory::GetForProfile(profile);
- service->ShowDesktopNotification(
- params, render_frame_host, delegate.Pass(), cancel_callback);
+ DCHECK(service);
+ service->ShowDesktopNotification(
+ params, render_process_id, delegate.Pass(), cancel_callback);
profile->GetHostContentSettingsMap()->UpdateLastUsage(
params.origin, params.origin, CONTENT_SETTINGS_TYPE_NOTIFICATIONS);
#else
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/browser/notifications/desktop_notification_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698