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 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 // add it to the appropriate tabstrip. | 569 // add it to the appropriate tabstrip. |
570 } | 570 } |
571 | 571 |
572 // If the user navigated from the omnibox, and the selected tab is going to | 572 // If the user navigated from the omnibox, and the selected tab is going to |
573 // lose focus, then make sure the focus for the source tab goes away from the | 573 // lose focus, then make sure the focus for the source tab goes away from the |
574 // omnibox. | 574 // omnibox. |
575 if (params->source_contents && | 575 if (params->source_contents && |
576 (params->disposition == NEW_FOREGROUND_TAB || | 576 (params->disposition == NEW_FOREGROUND_TAB || |
577 params->disposition == NEW_WINDOW) && | 577 params->disposition == NEW_WINDOW) && |
578 (params->tabstrip_add_types & TabStripModel::ADD_INHERIT_OPENER)) | 578 (params->tabstrip_add_types & TabStripModel::ADD_INHERIT_OPENER)) |
579 params->source_contents->Focus(); | 579 params->source_contents->GetView()->Focus(); |
580 | 580 |
581 if (params->source_contents == params->target_contents || | 581 if (params->source_contents == params->target_contents || |
582 (swapped_in_instant && params->disposition == CURRENT_TAB)) { | 582 (swapped_in_instant && params->disposition == CURRENT_TAB)) { |
583 // The navigation occurred in the source tab. | 583 // The navigation occurred in the source tab. |
584 params->browser->UpdateUIForNavigationInTab(params->target_contents, | 584 params->browser->UpdateUIForNavigationInTab(params->target_contents, |
585 params->transition, | 585 params->transition, |
586 user_initiated); | 586 user_initiated); |
587 } else if (singleton_index == -1) { | 587 } else if (singleton_index == -1) { |
588 // If some non-default value is set for the index, we should tell the | 588 // If some non-default value is set for the index, we should tell the |
589 // TabStripModel to respect it. | 589 // TabStripModel to respect it. |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 bool reverse_on_redirect = false; | 646 bool reverse_on_redirect = false; |
647 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( | 647 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( |
648 &rewritten_url, browser_context, &reverse_on_redirect); | 648 &rewritten_url, browser_context, &reverse_on_redirect); |
649 | 649 |
650 // Some URLs are mapped to uber subpages. Do not allow them in incognito. | 650 // Some URLs are mapped to uber subpages. Do not allow them in incognito. |
651 return !(rewritten_url.scheme() == chrome::kChromeUIScheme && | 651 return !(rewritten_url.scheme() == chrome::kChromeUIScheme && |
652 rewritten_url.host() == chrome::kChromeUIUberHost); | 652 rewritten_url.host() == chrome::kChromeUIUberHost); |
653 } | 653 } |
654 | 654 |
655 } // namespace chrome | 655 } // namespace chrome |
OLD | NEW |