| 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/macros.h" | 10 #include "base/macros.h" |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 // omnibox. | 547 // omnibox. |
| 548 if (params->source_contents && | 548 if (params->source_contents && |
| 549 (params->disposition == NEW_FOREGROUND_TAB || | 549 (params->disposition == NEW_FOREGROUND_TAB || |
| 550 params->disposition == NEW_WINDOW) && | 550 params->disposition == NEW_WINDOW) && |
| 551 (params->tabstrip_add_types & TabStripModel::ADD_INHERIT_OPENER)) | 551 (params->tabstrip_add_types & TabStripModel::ADD_INHERIT_OPENER)) |
| 552 params->source_contents->Focus(); | 552 params->source_contents->Focus(); |
| 553 | 553 |
| 554 if (params->source_contents == params->target_contents || | 554 if (params->source_contents == params->target_contents || |
| 555 (swapped_in_prerender && params->disposition == CURRENT_TAB)) { | 555 (swapped_in_prerender && params->disposition == CURRENT_TAB)) { |
| 556 // The navigation occurred in the source tab. | 556 // The navigation occurred in the source tab. |
| 557 params->browser->UpdateUIForNavigationInTab(params->target_contents, | 557 params->browser->UpdateUIForNavigationInTab( |
| 558 params->transition, | 558 params->target_contents, params->transition, params->window_action, |
| 559 user_initiated); | 559 user_initiated); |
| 560 } else if (singleton_index == -1) { | 560 } else if (singleton_index == -1) { |
| 561 // If some non-default value is set for the index, we should tell the | 561 // If some non-default value is set for the index, we should tell the |
| 562 // TabStripModel to respect it. | 562 // TabStripModel to respect it. |
| 563 if (params->tabstrip_index != -1) | 563 if (params->tabstrip_index != -1) |
| 564 params->tabstrip_add_types |= TabStripModel::ADD_FORCE_INDEX; | 564 params->tabstrip_add_types |= TabStripModel::ADD_FORCE_INDEX; |
| 565 | 565 |
| 566 // The navigation should insert a new tab into the target Browser. | 566 // The navigation should insert a new tab into the target Browser. |
| 567 params->browser->tab_strip_model()->AddWebContents( | 567 params->browser->tab_strip_model()->AddWebContents( |
| 568 params->target_contents, | 568 params->target_contents, |
| 569 params->tabstrip_index, | 569 params->tabstrip_index, |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 bool reverse_on_redirect = false; | 651 bool reverse_on_redirect = false; |
| 652 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( | 652 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( |
| 653 &rewritten_url, browser_context, &reverse_on_redirect); | 653 &rewritten_url, browser_context, &reverse_on_redirect); |
| 654 | 654 |
| 655 // Some URLs are mapped to uber subpages. Do not allow them in incognito. | 655 // Some URLs are mapped to uber subpages. Do not allow them in incognito. |
| 656 return !(rewritten_url.scheme() == content::kChromeUIScheme && | 656 return !(rewritten_url.scheme() == content::kChromeUIScheme && |
| 657 rewritten_url.host() == chrome::kChromeUIUberHost); | 657 rewritten_url.host() == chrome::kChromeUIUberHost); |
| 658 } | 658 } |
| 659 | 659 |
| 660 } // namespace chrome | 660 } // namespace chrome |
| OLD | NEW |