Chromium Code Reviews| Index: content/browser/service_worker/service_worker_version.cc |
| diff --git a/content/browser/service_worker/service_worker_version.cc b/content/browser/service_worker/service_worker_version.cc |
| index 198a02dc76fd9eda28070fecb227b64b620fac9a..17ded798c990a7f930c5423dff5cfe1ebc4948f5 100644 |
| --- a/content/browser/service_worker/service_worker_version.cc |
| +++ b/content/browser/service_worker/service_worker_version.cc |
| @@ -219,6 +219,13 @@ class WindowOpenedObserver : public WebContentsObserver { |
| DISALLOW_COPY_AND_ASSIGN(WindowOpenedObserver); |
| }; |
| +void DidOpenWindowOnUI( |
|
mlamouri (slow - plz ping)
2015/02/09 12:07:37
nit: DidOpenURL would be the right name for a call
Peter Beverloo
2015/02/10 17:49:37
Done.
|
| + const WindowOpenedCallback& callback, WebContents* web_contents) { |
| + DCHECK(web_contents); |
| + |
| + new WindowOpenedObserver(web_contents, callback); |
| +} |
| + |
| void OpenWindowOnUI( |
| const GURL& url, |
| const GURL& script_url, |
| @@ -250,11 +257,9 @@ void OpenWindowOnUI( |
| ui::PAGE_TRANSITION_AUTO_TOPLEVEL, |
| true /* is_renderer_initiated */); |
| - WebContents* web_contents = |
| - GetContentClient()->browser()->OpenURL(browser_context, params); |
| - DCHECK(web_contents); |
| - |
| - new WindowOpenedObserver(web_contents, callback); |
| + GetContentClient()->browser()->OpenURL( |
| + browser_context, params, |
| + base::Bind(&DidOpenWindowOnUI, callback)); |
|
mlamouri (slow - plz ping)
2015/02/09 12:07:37
Alternatively, you could pass browser_context and
Peter Beverloo
2015/02/10 17:49:37
I don't feel strongly about this code, so I'll lea
|
| } |
| void KillEmbeddedWorkerProcess(int process_id, ResultCode code) { |