| 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 18 matching lines...) Expand all Loading... |
| 29 #include "chrome/browser/ui/singleton_tabs.h" | 29 #include "chrome/browser/ui/singleton_tabs.h" |
| 30 #include "chrome/browser/ui/status_bubble.h" | 30 #include "chrome/browser/ui/status_bubble.h" |
| 31 #include "chrome/browser/ui/tab_helpers.h" | 31 #include "chrome/browser/ui/tab_helpers.h" |
| 32 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 32 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 33 #include "chrome/common/url_constants.h" | 33 #include "chrome/common/url_constants.h" |
| 34 #include "content/public/browser/browser_url_handler.h" | 34 #include "content/public/browser/browser_url_handler.h" |
| 35 #include "content/public/browser/navigation_entry.h" | 35 #include "content/public/browser/navigation_entry.h" |
| 36 #include "content/public/browser/notification_service.h" | 36 #include "content/public/browser/notification_service.h" |
| 37 #include "content/public/browser/render_view_host.h" | 37 #include "content/public/browser/render_view_host.h" |
| 38 #include "content/public/browser/web_contents.h" | 38 #include "content/public/browser/web_contents.h" |
| 39 #include "content/public/browser/web_contents_source.h" |
| 39 | 40 |
| 40 #if defined(USE_ASH) | 41 #if defined(USE_ASH) |
| 41 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" | 42 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" |
| 42 #endif | 43 #endif |
| 43 | 44 |
| 44 #if defined(USE_AURA) | 45 #if defined(USE_AURA) |
| 45 #include "ui/aura/window.h" | 46 #include "ui/aura/window.h" |
| 46 #endif | 47 #endif |
| 47 | 48 |
| 48 #if defined(ENABLE_EXTENSIONS) | 49 #if defined(ENABLE_EXTENSIONS) |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 | 365 |
| 365 #if defined(USE_AURA) | 366 #if defined(USE_AURA) |
| 366 if (params.browser->window() && | 367 if (params.browser->window() && |
| 367 params.browser->window()->GetNativeWindow()) { | 368 params.browser->window()->GetNativeWindow()) { |
| 368 create_params.context = | 369 create_params.context = |
| 369 params.browser->window()->GetNativeWindow(); | 370 params.browser->window()->GetNativeWindow(); |
| 370 } | 371 } |
| 371 #endif | 372 #endif |
| 372 | 373 |
| 373 WebContents* target_contents = WebContents::Create(create_params); | 374 WebContents* target_contents = WebContents::Create(create_params); |
| 375 WebContentsSource::CreateForWebContentsAndLocation(target_contents, |
| 376 FROM_HERE); |
| 374 | 377 |
| 375 // New tabs can have WebUI URLs that will make calls back to arbitrary | 378 // New tabs can have WebUI URLs that will make calls back to arbitrary |
| 376 // tab helpers, so the entire set of tab helpers needs to be set up | 379 // tab helpers, so the entire set of tab helpers needs to be set up |
| 377 // immediately. | 380 // immediately. |
| 378 BrowserNavigatorWebContentsAdoption::AttachTabHelpers(target_contents); | 381 BrowserNavigatorWebContentsAdoption::AttachTabHelpers(target_contents); |
| 379 #if defined(ENABLE_EXTENSIONS) | 382 #if defined(ENABLE_EXTENSIONS) |
| 380 extensions::TabHelper::FromWebContents(target_contents)-> | 383 extensions::TabHelper::FromWebContents(target_contents)-> |
| 381 SetExtensionAppById(params.extension_app_id); | 384 SetExtensionAppById(params.extension_app_id); |
| 382 #endif | 385 #endif |
| 383 return target_contents; | 386 return target_contents; |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 bool reverse_on_redirect = false; | 662 bool reverse_on_redirect = false; |
| 660 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( | 663 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( |
| 661 &rewritten_url, browser_context, &reverse_on_redirect); | 664 &rewritten_url, browser_context, &reverse_on_redirect); |
| 662 | 665 |
| 663 // Some URLs are mapped to uber subpages. Do not allow them in incognito. | 666 // Some URLs are mapped to uber subpages. Do not allow them in incognito. |
| 664 return !(rewritten_url.scheme() == content::kChromeUIScheme && | 667 return !(rewritten_url.scheme() == content::kChromeUIScheme && |
| 665 rewritten_url.host() == chrome::kChromeUIUberHost); | 668 rewritten_url.host() == chrome::kChromeUIUberHost); |
| 666 } | 669 } |
| 667 | 670 |
| 668 } // namespace chrome | 671 } // namespace chrome |
| OLD | NEW |