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

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

Issue 897673002: First step in enabling creating tabs without an Activity on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@a-base-mounir
Patch Set: rebase Created 5 years, 10 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
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | content/public/browser/content_browser_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4da0c87085a4d50d6b5e0d8603ae7c82fa457652..352c33d7e7072c77468e88eb0f5054f286bcf823 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 DidOpenURL(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(
NEW_FOREGROUND_TAB, 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(&DidOpenURL, callback));
}
void KillEmbeddedWorkerProcess(int process_id, ResultCode code) {
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | content/public/browser/content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698