OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/service_worker/service_worker_version.h" | 5 #include "content/browser/service_worker/service_worker_version.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 ChildProcessHost::kInvalidUniqueID, | 248 ChildProcessHost::kInvalidUniqueID, |
249 MSG_ROUTING_NONE)); | 249 MSG_ROUTING_NONE)); |
250 return; | 250 return; |
251 } | 251 } |
252 | 252 |
253 OpenURLParams params( | 253 OpenURLParams params( |
254 url, Referrer::SanitizeForRequest( | 254 url, Referrer::SanitizeForRequest( |
255 url, Referrer(script_url, blink::WebReferrerPolicyDefault)), | 255 url, Referrer(script_url, blink::WebReferrerPolicyDefault)), |
256 NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_AUTO_TOPLEVEL, | 256 NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_AUTO_TOPLEVEL, |
257 true /* is_renderer_initiated */); | 257 true /* is_renderer_initiated */); |
| 258 // Service Workers only allow openWindow() to be called in reponse to a user |
| 259 // gesture (e.g. notificationclick event). |
| 260 params.user_gesture = true; |
258 | 261 |
259 GetContentClient()->browser()->OpenURL( | 262 GetContentClient()->browser()->OpenURL( |
260 browser_context, params, | 263 browser_context, params, |
261 base::Bind(&DidOpenURL, callback)); | 264 base::Bind(&DidOpenURL, callback)); |
262 } | 265 } |
263 | 266 |
264 void KillEmbeddedWorkerProcess(int process_id, ResultCode code) { | 267 void KillEmbeddedWorkerProcess(int process_id, ResultCode code) { |
265 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 268 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
266 RenderProcessHost* render_process_host = | 269 RenderProcessHost* render_process_host = |
267 RenderProcessHost::FromID(process_id); | 270 RenderProcessHost::FromID(process_id); |
(...skipping 1634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1902 return SERVICE_WORKER_ERROR_ABORT; | 1905 return SERVICE_WORKER_ERROR_ABORT; |
1903 default: | 1906 default: |
1904 return SERVICE_WORKER_ERROR_NETWORK; | 1907 return SERVICE_WORKER_ERROR_NETWORK; |
1905 } | 1908 } |
1906 } | 1909 } |
1907 | 1910 |
1908 return default_code; | 1911 return default_code; |
1909 } | 1912 } |
1910 | 1913 |
1911 } // namespace content | 1914 } // namespace content |
OLD | NEW |