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

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

Issue 758603002: Use Mojo Permission Service when requesting Notifications permission. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permission_geolocation_follow_up
Patch Set: fixes to pass tests Created 6 years, 1 month 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 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

Powered by Google App Engine
This is Rietveld 408576698