| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/browser_about_handler.h" | 10 #include "chrome/browser/browser_about_handler.h" |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 } else if (params->path_behavior == NavigateParams::IGNORE_AND_NAVIGATE && | 474 } else if (params->path_behavior == NavigateParams::IGNORE_AND_NAVIGATE && |
| 475 target->GetURL() != params->url) { | 475 target->GetURL() != params->url) { |
| 476 target->controller().LoadURL( | 476 target->controller().LoadURL( |
| 477 params->url, params->referrer, params->transition); | 477 params->url, params->referrer, params->transition); |
| 478 } | 478 } |
| 479 | 479 |
| 480 // If the singleton tab isn't already selected, select it. | 480 // If the singleton tab isn't already selected, select it. |
| 481 if (params->source_contents != params->target_contents) | 481 if (params->source_contents != params->target_contents) |
| 482 params->browser->ActivateTabAt(singleton_index, user_initiated); | 482 params->browser->ActivateTabAt(singleton_index, user_initiated); |
| 483 } | 483 } |
| 484 |
| 485 NotificationService::current()->Notify( |
| 486 content::NOTIFICATION_TAB_ADDED, |
| 487 Source<TabContentsDelegate>(params->browser), |
| 488 Details<TabContents>(params->target_contents->tab_contents())); |
| 484 } | 489 } |
| 485 | 490 |
| 486 // Returns the index of an existing singleton tab in |params->browser| matching | 491 // Returns the index of an existing singleton tab in |params->browser| matching |
| 487 // the URL specified in |params|. | 492 // the URL specified in |params|. |
| 488 int GetIndexOfSingletonTab(browser::NavigateParams* params) { | 493 int GetIndexOfSingletonTab(browser::NavigateParams* params) { |
| 489 if (params->disposition != SINGLETON_TAB) | 494 if (params->disposition != SINGLETON_TAB) |
| 490 return -1; | 495 return -1; |
| 491 | 496 |
| 492 // In case the URL was rewritten by the BrowserURLHandler we need to ensure | 497 // In case the URL was rewritten by the BrowserURLHandler we need to ensure |
| 493 // that we do not open another URL that will get redirected to the rewritten | 498 // that we do not open another URL that will get redirected to the rewritten |
| (...skipping 28 matching lines...) Expand all Loading... |
| 522 rewritten_url, replacements)) { | 527 rewritten_url, replacements)) { |
| 523 params->target_contents = tab; | 528 params->target_contents = tab; |
| 524 return tab_index; | 529 return tab_index; |
| 525 } | 530 } |
| 526 } | 531 } |
| 527 | 532 |
| 528 return -1; | 533 return -1; |
| 529 } | 534 } |
| 530 | 535 |
| 531 } // namespace browser | 536 } // namespace browser |
| OLD | NEW |