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..fc741e7e191bf783d2593dc1294fba1471fa150d 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->ActivateForUserGesture(); |
return ServiceWorkerProviderHost::GetWindowClientInfoOnUI(render_process_id, |
render_frame_id); |