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

Unified Diff: content/shell/browser/shell.cc

Issue 2680353005: WebContents created via ctrl-click should be in a new process (target=_blank). (Closed)
Patch Set: Rebasing... Created 3 years, 8 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/shell/browser/shell.cc
diff --git a/content/shell/browser/shell.cc b/content/shell/browser/shell.cc
index e07196b04cc80228cad8e5c4cd613e7d9014d191..74de055a8b09dc1fcafc994d33076a4721b40496 100644
--- a/content/shell/browser/shell.cc
+++ b/content/shell/browser/shell.cc
@@ -326,7 +326,12 @@ WebContents* Shell::OpenURLFromTab(WebContents* source,
// content shell and layout tests, popups don't get special treatment below
// (i.e. they will have a toolbar and other things described here).
case WindowOpenDisposition::NEW_POPUP:
- case WindowOpenDisposition::NEW_WINDOW: {
+ case WindowOpenDisposition::NEW_WINDOW:
+ // content_shell doesn't really support tabs, but some layout tests use
+ // middle click (which translates into kNavigationPolicyNewBackgroundTab),
+ // so we treat the cases below just like a NEW_WINDOW disposition.
+ case WindowOpenDisposition::NEW_BACKGROUND_TAB:
+ case WindowOpenDisposition::NEW_FOREGROUND_TAB: {
Shell* new_window =
Shell::CreateNewWindow(source->GetBrowserContext(),
GURL(), // Don't load anything just yet.
@@ -340,8 +345,6 @@ WebContents* Shell::OpenURLFromTab(WebContents* source,
// No tabs in content_shell:
case WindowOpenDisposition::SINGLETON_TAB:
- case WindowOpenDisposition::NEW_FOREGROUND_TAB:
- case WindowOpenDisposition::NEW_BACKGROUND_TAB:
// No incognito mode in content_shell:
case WindowOpenDisposition::OFF_THE_RECORD:
// TODO(lukasza): Investigate if some layout tests might need support for

Powered by Google App Engine
This is Rietveld 408576698