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

Side by Side 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 unified diff | Download patch
OLDNEW
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/shell/browser/shell.h" 5 #include "content/shell/browser/shell.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 case WindowOpenDisposition::CURRENT_TAB: 319 case WindowOpenDisposition::CURRENT_TAB:
320 target = source; 320 target = source;
321 break; 321 break;
322 322
323 // Normally, the difference between NEW_POPUP and NEW_WINDOW is that a popup 323 // Normally, the difference between NEW_POPUP and NEW_WINDOW is that a popup
324 // should have no toolbar, no status bar, no menu bar, no scrollbars and be 324 // should have no toolbar, no status bar, no menu bar, no scrollbars and be
325 // not resizable. For simplicity and to enable new testing scenarios in 325 // not resizable. For simplicity and to enable new testing scenarios in
326 // content shell and layout tests, popups don't get special treatment below 326 // content shell and layout tests, popups don't get special treatment below
327 // (i.e. they will have a toolbar and other things described here). 327 // (i.e. they will have a toolbar and other things described here).
328 case WindowOpenDisposition::NEW_POPUP: 328 case WindowOpenDisposition::NEW_POPUP:
329 case WindowOpenDisposition::NEW_WINDOW: { 329 case WindowOpenDisposition::NEW_WINDOW:
330 // content_shell doesn't really support tabs, but some layout tests use
331 // middle click (which translates into kNavigationPolicyNewBackgroundTab),
332 // so we treat the cases below just like a NEW_WINDOW disposition.
333 case WindowOpenDisposition::NEW_BACKGROUND_TAB:
334 case WindowOpenDisposition::NEW_FOREGROUND_TAB: {
330 Shell* new_window = 335 Shell* new_window =
331 Shell::CreateNewWindow(source->GetBrowserContext(), 336 Shell::CreateNewWindow(source->GetBrowserContext(),
332 GURL(), // Don't load anything just yet. 337 GURL(), // Don't load anything just yet.
333 params.source_site_instance, 338 params.source_site_instance,
334 gfx::Size()); // Use default size. 339 gfx::Size()); // Use default size.
335 target = new_window->web_contents(); 340 target = new_window->web_contents();
336 if (switches::IsRunLayoutTestSwitchPresent()) 341 if (switches::IsRunLayoutTestSwitchPresent())
337 SecondaryTestWindowObserver::CreateForWebContents(target); 342 SecondaryTestWindowObserver::CreateForWebContents(target);
338 break; 343 break;
339 } 344 }
340 345
341 // No tabs in content_shell: 346 // No tabs in content_shell:
342 case WindowOpenDisposition::SINGLETON_TAB: 347 case WindowOpenDisposition::SINGLETON_TAB:
343 case WindowOpenDisposition::NEW_FOREGROUND_TAB:
344 case WindowOpenDisposition::NEW_BACKGROUND_TAB:
345 // No incognito mode in content_shell: 348 // No incognito mode in content_shell:
346 case WindowOpenDisposition::OFF_THE_RECORD: 349 case WindowOpenDisposition::OFF_THE_RECORD:
347 // TODO(lukasza): Investigate if some layout tests might need support for 350 // TODO(lukasza): Investigate if some layout tests might need support for
348 // SAVE_TO_DISK disposition. This would probably require that 351 // SAVE_TO_DISK disposition. This would probably require that
349 // BlinkTestController always sets up and cleans up a temporary directory 352 // BlinkTestController always sets up and cleans up a temporary directory
350 // as the default downloads destinations for the duration of a test. 353 // as the default downloads destinations for the duration of a test.
351 case WindowOpenDisposition::SAVE_TO_DISK: 354 case WindowOpenDisposition::SAVE_TO_DISK:
352 // Ignoring requests with disposition == IGNORE_ACTION... 355 // Ignoring requests with disposition == IGNORE_ACTION...
353 case WindowOpenDisposition::IGNORE_ACTION: 356 case WindowOpenDisposition::IGNORE_ACTION:
354 default: 357 default:
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 if (entry) 524 if (entry)
522 PlatformSetTitle(entry->GetTitle()); 525 PlatformSetTitle(entry->GetTitle());
523 } 526 }
524 527
525 void Shell::OnDevToolsWebContentsDestroyed() { 528 void Shell::OnDevToolsWebContentsDestroyed() {
526 devtools_observer_.reset(); 529 devtools_observer_.reset();
527 devtools_frontend_ = NULL; 530 devtools_frontend_ = NULL;
528 } 531 }
529 532
530 } // namespace content 533 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698