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

Unified Diff: content/browser/service_worker/service_worker_provider_host.cc

Issue 1153793003: Add user_gesture param to WebContentsImpl::Activate Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update callers Created 5 years, 7 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/browser/service_worker/service_worker_provider_host.cc
diff --git a/content/browser/service_worker/service_worker_provider_host.cc b/content/browser/service_worker/service_worker_provider_host.cc
index 6a79c56d753730f444f8e027745818d1db8ea1ea..59bc89f5db8dea2596e609c6c06b1c6497f191c8 100644
--- a/content/browser/service_worker/service_worker_provider_host.cc
+++ b/content/browser/service_worker/service_worker_provider_host.cc
@@ -50,8 +50,9 @@ ServiceWorkerClientInfo FocusOnUIThread(
// Focus the frame's view to make sure the frame is now considered as focused.
render_frame_host->GetView()->Focus();
- // Move the web contents to the foreground.
- web_contents->Activate();
+ // Move the web contents to the foreground. Service Workers only allow focus()
+ // to be called in reponse to a user gesture (e.g. notificationclick event).
+ web_contents->Activate(true /* user_gesture */);
return ServiceWorkerProviderHost::GetWindowClientInfoOnUI(render_process_id,
render_frame_id);
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.cc ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698