Chromium Code Reviews| 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/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 361 create_params.created_with_opener = params.created_with_opener; | 361 create_params.created_with_opener = params.created_with_opener; |
| 362 } | 362 } |
| 363 if (params.disposition == NEW_BACKGROUND_TAB) | 363 if (params.disposition == NEW_BACKGROUND_TAB) |
| 364 create_params.initially_hidden = true; | 364 create_params.initially_hidden = true; |
| 365 | 365 |
| 366 #if defined(USE_AURA) | 366 #if defined(USE_AURA) |
| 367 if (params.browser->window() && | 367 if (params.browser->window() && |
| 368 params.browser->window()->GetNativeWindow()) { | 368 params.browser->window()->GetNativeWindow()) { |
| 369 create_params.context = | 369 create_params.context = |
| 370 params.browser->window()->GetNativeWindow(); | 370 params.browser->window()->GetNativeWindow(); |
| 371 #if defined(MOJO_SHELL_CLIENT) | |
| 372 create_params.mus_window = static_cast<mus::Window*>( | |
| 373 create_params.context->GetNativeWindowProperty("mus")); | |
|
Ben Goodger (Google)
2015/11/24 15:30:05
let's create a helper function somewhere and use t
Fady Samuel
2015/11/24 17:06:36
Done.
| |
| 374 #endif | |
| 371 } | 375 } |
| 372 #endif | 376 #endif |
| 373 | 377 |
| 374 WebContents* target_contents = WebContents::Create(create_params); | 378 WebContents* target_contents = WebContents::Create(create_params); |
| 375 | 379 |
| 376 // New tabs can have WebUI URLs that will make calls back to arbitrary | 380 // New tabs can have WebUI URLs that will make calls back to arbitrary |
| 377 // tab helpers, so the entire set of tab helpers needs to be set up | 381 // tab helpers, so the entire set of tab helpers needs to be set up |
| 378 // immediately. | 382 // immediately. |
| 379 BrowserNavigatorWebContentsAdoption::AttachTabHelpers(target_contents); | 383 BrowserNavigatorWebContentsAdoption::AttachTabHelpers(target_contents); |
| 380 #if defined(ENABLE_EXTENSIONS) | 384 #if defined(ENABLE_EXTENSIONS) |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 660 bool reverse_on_redirect = false; | 664 bool reverse_on_redirect = false; |
| 661 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( | 665 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( |
| 662 &rewritten_url, browser_context, &reverse_on_redirect); | 666 &rewritten_url, browser_context, &reverse_on_redirect); |
| 663 | 667 |
| 664 // Some URLs are mapped to uber subpages. Do not allow them in incognito. | 668 // Some URLs are mapped to uber subpages. Do not allow them in incognito. |
| 665 return !(rewritten_url.scheme() == content::kChromeUIScheme && | 669 return !(rewritten_url.scheme() == content::kChromeUIScheme && |
| 666 rewritten_url.host() == chrome::kChromeUIUberHost); | 670 rewritten_url.host() == chrome::kChromeUIUberHost); |
| 667 } | 671 } |
| 668 | 672 |
| 669 } // namespace chrome | 673 } // namespace chrome |
| OLD | NEW |