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/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 chrome::GetWebContentsAt(params->browser, singleton_index); | 553 chrome::GetWebContentsAt(params->browser, singleton_index); |
554 | 554 |
555 if (target->IsCrashed()) { | 555 if (target->IsCrashed()) { |
556 target->GetController().Reload(true); | 556 target->GetController().Reload(true); |
557 } else if (params->path_behavior == NavigateParams::IGNORE_AND_NAVIGATE && | 557 } else if (params->path_behavior == NavigateParams::IGNORE_AND_NAVIGATE && |
558 target->GetURL() != params->url) { | 558 target->GetURL() != params->url) { |
559 LoadURLInContents(target, params->url, params); | 559 LoadURLInContents(target, params->url, params); |
560 } | 560 } |
561 | 561 |
562 // If the singleton tab isn't already selected, select it. | 562 // If the singleton tab isn't already selected, select it. |
563 if (params->source_contents != params->target_contents) | 563 if (params->source_contents != params->target_contents) { |
564 chrome::ActivateTabAt(params->browser, singleton_index, user_initiated); | 564 params->browser->tab_strip_model()->ActivateTabAt(singleton_index, |
| 565 user_initiated); |
| 566 } |
565 } | 567 } |
566 | 568 |
567 if (params->disposition != CURRENT_TAB) { | 569 if (params->disposition != CURRENT_TAB) { |
568 content::NotificationService::current()->Notify( | 570 content::NotificationService::current()->Notify( |
569 chrome::NOTIFICATION_TAB_ADDED, | 571 chrome::NOTIFICATION_TAB_ADDED, |
570 content::Source<content::WebContentsDelegate>(params->browser), | 572 content::Source<content::WebContentsDelegate>(params->browser), |
571 content::Details<WebContents>(params->target_contents->web_contents())); | 573 content::Details<WebContents>(params->target_contents->web_contents())); |
572 } | 574 } |
573 } | 575 } |
574 | 576 |
(...skipping 16 matching lines...) Expand all Loading... |
591 bool reverse_on_redirect = false; | 593 bool reverse_on_redirect = false; |
592 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( | 594 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( |
593 &rewritten_url, browser_context, &reverse_on_redirect); | 595 &rewritten_url, browser_context, &reverse_on_redirect); |
594 | 596 |
595 // Some URLs are mapped to uber subpages. Do not allow them in incognito. | 597 // Some URLs are mapped to uber subpages. Do not allow them in incognito. |
596 return !(rewritten_url.scheme() == chrome::kChromeUIScheme && | 598 return !(rewritten_url.scheme() == chrome::kChromeUIScheme && |
597 rewritten_url.host() == chrome::kChromeUIUberHost); | 599 rewritten_url.host() == chrome::kChromeUIUberHost); |
598 } | 600 } |
599 | 601 |
600 } // namespace chrome | 602 } // namespace chrome |
OLD | NEW |