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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 376253005: Migrate the notification permission to the new common permission classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 b0716a9223a25765c9b01a3776aa044f482cb491..b654f64c373819781a125404406cb5773972603e 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -2130,8 +2130,22 @@ void ChromeContentBrowserClient::RequestDesktopNotificationPermission(
return;
}
+ WebContents* web_contents = WebContents::FromRenderFrameHost(
+ render_frame_host);
Peter Beverloo 2014/07/18 10:42:38 nit: four space indent
Miguel Garcia 2014/07/18 12:27:08 Done.
+ int render_process_id = render_frame_host->GetProcess()->GetID();
+ const PermissionRequestID id(render_process_id,
Peter Beverloo 2014/07/18 10:42:37 nit: s/id/request_id/ for consistency.
Miguel Garcia 2014/07/18 12:27:08 Done.
+ web_contents->GetRoutingID(), -1 /* bridge id */,
Peter Beverloo 2014/07/18 10:42:37 nit: one argument a line.
Miguel Garcia 2014/07/18 12:27:08 Done.
+ GURL());
+
notification_service->RequestPermission(
- source_origin, render_frame_host, callback);
+ web_contents,
+ id,
+ source_origin,
+ // TODO(peter): plumb user_gesture over IPC
+ true,
+ base::Bind(&ChromeContentBrowserClient::NotificationPermissionRequested,
+ weak_factory_.GetWeakPtr(), callback));
Peter Beverloo 2014/07/18 10:42:37 nit: |callback| should be on its own line.
Miguel Garcia 2014/07/18 12:27:08 Done.
+
#else
NOTIMPLEMENTED();
#endif
@@ -2921,4 +2935,10 @@ void ChromeContentBrowserClient::MaybeCopyDisableWebRtcEncryptionSwitch(
}
#endif // defined(ENABLE_WEBRTC)
+
+void ChromeContentBrowserClient::NotificationPermissionRequested(
+ base::Closure callback, bool result) {
+ callback.Run();
+}
+
} // namespace chrome

Powered by Google App Engine
This is Rietveld 408576698