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 3a3a54c0d77221356949903399a5e7d01c5c3ae7..b4b2b08023aaf4608d4a8d38596164887c54e25b 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 |
@@ -24,10 +24,14 @@ void RequestDesktopNotificationPermissionOnIO( |
const base::Callback<void(bool)>& callback) { |
LayoutTestNotificationManager* manager = |
LayoutTestContentBrowserClient::Get()->GetLayoutTestNotificationManager(); |
- if (manager) |
- manager->RequestPermission(source_origin, callback); |
- else |
- callback.Run(true); |
+ bool allowed = manager ? manager->RequestPermission(source_origin) |
+ : true; |
+ |
+ // The callback came from the UI thread, we need to run it from there again. |
+ BrowserThread::PostTask( |
+ BrowserThread::UI, |
+ FROM_HERE, |
+ base::Bind(callback, allowed)); |
} |
} // namespace |