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

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: rebase 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 f9e7a7203ec0947e8f986c63ad0f19e674b90c1a..da5c268d0018978626859144d9af9b73d74bfbdd 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -2133,8 +2133,24 @@ void ChromeContentBrowserClient::RequestDesktopNotificationPermission(
return;
}
+ WebContents* web_contents = WebContents::FromRenderFrameHost(
+ render_frame_host);
+ int render_process_id = render_frame_host->GetProcess()->GetID();
+ const PermissionRequestID request_id(render_process_id,
+ web_contents->GetRoutingID(),
+ -1 /* bridge id */,
+ GURL());
+
notification_service->RequestPermission(
- source_origin, render_frame_host, callback);
+ web_contents,
+ request_id,
+ source_origin,
+ // TODO(peter): plumb user_gesture over IPC
+ true,
+ base::Bind(&ChromeContentBrowserClient::NotificationPermissionRequested,
+ weak_factory_.GetWeakPtr(),
+ callback));
+
#else
NOTIMPLEMENTED();
#endif
@@ -2939,4 +2955,10 @@ void ChromeContentBrowserClient::MaybeCopyDisableWebRtcEncryptionSwitch(
}
#endif // defined(ENABLE_WEBRTC)
+
+void ChromeContentBrowserClient::NotificationPermissionRequested(
+ const base::Closure& callback, bool result) {
+ callback.Run();
+}
+
} // namespace chrome
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/browser/content_settings/permission_bubble_request_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698