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 5194da29cd364dc29a82b1b2dcd9efbc1767f04d..2b208feb3c24d2017a1a87754064f7d1515798af 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 |
@@ -72,17 +71,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) { |
+ if (permission == content::PERMISSION_NOTIFICATIONS) { |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
Peter Beverloo
2014/10/24 14:37:28
Lift this DCHECK up one level higher please. It'd
Miguel Garcia
2014/10/24 16:05:32
Done.
|
+ 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 |