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

Unified Diff: content/shell/browser/layout_test/layout_test_content_browser_client.cc

Issue 622793002: Group the different permission related methods in the content api. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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: content/shell/browser/layout_test/layout_test_content_browser_client.cc
diff --git a/content/shell/browser/layout_test/layout_test_content_browser_client.cc b/content/shell/browser/layout_test/layout_test_content_browser_client.cc
index 54d42af72cf9dbc45be300c6bc95a990e5f14e80..9bcd87102e97d06eab0fc6a6f2a632ada2078e70 100644
--- a/content/shell/browser/layout_test/layout_test_content_browser_client.cc
+++ b/content/shell/browser/layout_test/layout_test_content_browser_client.cc
@@ -21,14 +21,13 @@ LayoutTestContentBrowserClient* g_layout_test_browser_client;
void RequestDesktopNotificationPermissionOnIO(
const GURL& source_origin,
- RenderFrameHost* render_frame_host,
- const base::Callback<void(blink::WebNotificationPermission)>& callback) {
+ const base::Callback<void(bool)>& callback) {
LayoutTestNotificationManager* manager =
LayoutTestContentBrowserClient::Get()->GetLayoutTestNotificationManager();
if (manager)
manager->RequestPermission(source_origin, callback);
else
- callback.Run(blink::WebNotificationPermissionAllowed);
+ callback.Run(true);
}
} // namespace
@@ -70,17 +69,29 @@ void LayoutTestContentBrowserClient::RenderProcessWillLaunch(
host->Send(new ShellViewMsg_SetWebKitSourceDir(GetWebKitRootDirFilePath()));
}
-void LayoutTestContentBrowserClient::RequestDesktopNotificationPermission(
- const GURL& source_origin,
- RenderFrameHost* render_frame_host,
- const base::Callback<void(blink::WebNotificationPermission)>& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- BrowserThread::PostTask(BrowserThread::IO,
- FROM_HERE,
- base::Bind(&RequestDesktopNotificationPermissionOnIO,
- source_origin,
- render_frame_host,
- callback));
+void LayoutTestContentBrowserClient::RequestPermission(
+ PermissionType permission,
+ WebContents* web_contents,
+ int bridge_id,
+ const GURL& requesting_frame,
+ bool user_gesture,
+ const base::Callback<void(bool)>& result_callback) {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ if (permission == content::PERMISSION_NOTIFICATIONS) {
+ BrowserThread::PostTask(
+ BrowserThread::IO,
+ FROM_HERE,
+ base::Bind(&RequestDesktopNotificationPermissionOnIO,
+ requesting_frame,
+ result_callback));
+ return;
+ }
+ ShellContentBrowserClient::RequestPermission(permission,
+ web_contents,
+ bridge_id,
+ requesting_frame,
+ user_gesture,
+ result_callback);
}
blink::WebNotificationPermission

Powered by Google App Engine
This is Rietveld 408576698