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" |
11 #include "base/stringprintf.h" | 11 #include "base/stringprintf.h" |
12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
13 #include "chrome/browser/browser_about_handler.h" | 13 #include "chrome/browser/browser_about_handler.h" |
14 #include "chrome/browser/extensions/extension_service.h" | 14 #include "chrome/browser/extensions/extension_service.h" |
| 15 #include "chrome/browser/extensions/extension_system.h" |
| 16 #include "chrome/browser/extensions/platform_app_redirector.h" |
15 #include "chrome/browser/extensions/tab_helper.h" | 17 #include "chrome/browser/extensions/tab_helper.h" |
16 #include "chrome/browser/google/google_url_tracker.h" | 18 #include "chrome/browser/google/google_url_tracker.h" |
17 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 19 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
18 #include "chrome/browser/prerender/prerender_manager.h" | 20 #include "chrome/browser/prerender/prerender_manager.h" |
19 #include "chrome/browser/prerender/prerender_manager_factory.h" | 21 #include "chrome/browser/prerender/prerender_manager_factory.h" |
20 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
21 #include "chrome/browser/tab_contents/tab_util.h" | 23 #include "chrome/browser/tab_contents/tab_util.h" |
22 #include "chrome/browser/ui/browser.h" | 24 #include "chrome/browser/ui/browser.h" |
23 #include "chrome/browser/ui/browser_finder.h" | 25 #include "chrome/browser/ui/browser_finder.h" |
24 #include "chrome/browser/ui/browser_instant_controller.h" | 26 #include "chrome/browser/ui/browser_instant_controller.h" |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 params->initiating_profile = source_browser->profile(); | 456 params->initiating_profile = source_browser->profile(); |
455 DCHECK(params->initiating_profile); | 457 DCHECK(params->initiating_profile); |
456 | 458 |
457 if (!AdjustNavigateParamsForURL(params)) | 459 if (!AdjustNavigateParamsForURL(params)) |
458 return; | 460 return; |
459 | 461 |
460 ExtensionService* service = params->initiating_profile->GetExtensionService(); | 462 ExtensionService* service = params->initiating_profile->GetExtensionService(); |
461 if (service) | 463 if (service) |
462 service->ShouldBlockUrlInBrowserTab(¶ms->url); | 464 service->ShouldBlockUrlInBrowserTab(¶ms->url); |
463 | 465 |
| 466 extensions::ExtensionSystem* system = |
| 467 extensions::ExtensionSystem::Get(params->initiating_profile); |
| 468 if (system) { |
| 469 extensions::PlatformAppRedirector* platform_app_redirector = |
| 470 system->platform_app_redirector(); |
| 471 |
| 472 if (platform_app_redirector && |
| 473 platform_app_redirector->MaybeLaunchPlatformAppWithUrl( |
| 474 params->url, params->referrer.url)) |
| 475 return; |
| 476 } |
| 477 |
464 // The browser window may want to adjust the disposition. | 478 // The browser window may want to adjust the disposition. |
465 if (params->disposition == NEW_POPUP && | 479 if (params->disposition == NEW_POPUP && |
466 source_browser && | 480 source_browser && |
467 source_browser->window()) { | 481 source_browser->window()) { |
468 params->disposition = | 482 params->disposition = |
469 source_browser->window()->GetDispositionForPopupBounds( | 483 source_browser->window()->GetDispositionForPopupBounds( |
470 params->window_bounds); | 484 params->window_bounds); |
471 } | 485 } |
472 | 486 |
473 params->browser = GetBrowserForDisposition(params); | 487 params->browser = GetBrowserForDisposition(params); |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 bool reverse_on_redirect = false; | 671 bool reverse_on_redirect = false; |
658 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( | 672 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( |
659 &rewritten_url, browser_context, &reverse_on_redirect); | 673 &rewritten_url, browser_context, &reverse_on_redirect); |
660 | 674 |
661 // Some URLs are mapped to uber subpages. Do not allow them in incognito. | 675 // Some URLs are mapped to uber subpages. Do not allow them in incognito. |
662 return !(rewritten_url.scheme() == chrome::kChromeUIScheme && | 676 return !(rewritten_url.scheme() == chrome::kChromeUIScheme && |
663 rewritten_url.host() == chrome::kChromeUIUberHost); | 677 rewritten_url.host() == chrome::kChromeUIUberHost); |
664 } | 678 } |
665 | 679 |
666 } // namespace chrome | 680 } // namespace chrome |
OLD | NEW |