| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/browser_navigator.h" | 5 #include "chrome/browser/ui/browser_navigator.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 private: | 349 private: |
| 350 chrome::NavigateParams* params_; | 350 chrome::NavigateParams* params_; |
| 351 std::unique_ptr<WebContents> target_contents_owner_; | 351 std::unique_ptr<WebContents> target_contents_owner_; |
| 352 DISALLOW_COPY_AND_ASSIGN(ScopedTargetContentsOwner); | 352 DISALLOW_COPY_AND_ASSIGN(ScopedTargetContentsOwner); |
| 353 }; | 353 }; |
| 354 | 354 |
| 355 content::WebContents* CreateTargetContents(const chrome::NavigateParams& params, | 355 content::WebContents* CreateTargetContents(const chrome::NavigateParams& params, |
| 356 const GURL& url) { | 356 const GURL& url) { |
| 357 WebContents::CreateParams create_params( | 357 WebContents::CreateParams create_params( |
| 358 params.browser->profile(), | 358 params.browser->profile(), |
| 359 params.source_site_instance | 359 params.source_site_instance && !params.force_new_process_for_new_contents |
| 360 ? params.source_site_instance | 360 ? params.source_site_instance |
| 361 : tab_util::GetSiteInstanceForNewTab(params.browser->profile(), url)); | 361 : tab_util::GetSiteInstanceForNewTab(params.browser->profile(), url)); |
| 362 create_params.main_frame_name = params.frame_name; | 362 create_params.main_frame_name = params.frame_name; |
| 363 if (params.source_contents) { | 363 if (params.source_contents) { |
| 364 create_params.initial_size = | 364 create_params.initial_size = |
| 365 params.source_contents->GetContainerBounds().size(); | 365 params.source_contents->GetContainerBounds().size(); |
| 366 create_params.created_with_opener = params.created_with_opener; | 366 create_params.created_with_opener = params.created_with_opener; |
| 367 } | 367 } |
| 368 if (params.disposition == WindowOpenDisposition::NEW_BACKGROUND_TAB) | 368 if (params.disposition == WindowOpenDisposition::NEW_BACKGROUND_TAB) |
| 369 create_params.initially_hidden = true; | 369 create_params.initially_hidden = true; |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 bool reverse_on_redirect = false; | 673 bool reverse_on_redirect = false; |
| 674 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( | 674 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( |
| 675 &rewritten_url, browser_context, &reverse_on_redirect); | 675 &rewritten_url, browser_context, &reverse_on_redirect); |
| 676 | 676 |
| 677 // Some URLs are mapped to uber subpages. Do not allow them in incognito. | 677 // Some URLs are mapped to uber subpages. Do not allow them in incognito. |
| 678 return !(rewritten_url.scheme_piece() == content::kChromeUIScheme && | 678 return !(rewritten_url.scheme_piece() == content::kChromeUIScheme && |
| 679 rewritten_url.host_piece() == chrome::kChromeUIUberHost); | 679 rewritten_url.host_piece() == chrome::kChromeUIUberHost); |
| 680 } | 680 } |
| 681 | 681 |
| 682 } // namespace chrome | 682 } // namespace chrome |
| OLD | NEW |