| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser_navigator.h" | 5 #include "chrome/browser/browser_navigator.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/browser.h" | 8 #include "chrome/browser/browser.h" |
| 9 #include "chrome/browser/browser_list.h" | 9 #include "chrome/browser/browser_list.h" |
| 10 #include "chrome/browser/browser_url_handler.h" | 10 #include "chrome/browser/browser_url_handler.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 if (params->browser->profile()->IsOffTheRecord() && | 178 if (params->browser->profile()->IsOffTheRecord() && |
| 179 params->disposition == OFF_THE_RECORD) { | 179 params->disposition == OFF_THE_RECORD) { |
| 180 params->disposition = NEW_FOREGROUND_TAB; | 180 params->disposition = NEW_FOREGROUND_TAB; |
| 181 } | 181 } |
| 182 | 182 |
| 183 // Disposition trumps add types. ADD_SELECTED is a default, so we need to | 183 // Disposition trumps add types. ADD_SELECTED is a default, so we need to |
| 184 // remove it if disposition implies the tab is going to open in the | 184 // remove it if disposition implies the tab is going to open in the |
| 185 // background. | 185 // background. |
| 186 if (params->disposition == NEW_BACKGROUND_TAB) | 186 if (params->disposition == NEW_BACKGROUND_TAB) |
| 187 params->tabstrip_add_types &= ~TabStripModel::ADD_SELECTED; | 187 params->tabstrip_add_types &= ~TabStripModel::ADD_SELECTED; |
| 188 else if (params->disposition == NEW_FOREGROUND_TAB) |
| 189 params->tabstrip_add_types |= TabStripModel::ADD_SELECTED; |
| 188 | 190 |
| 189 // Code that wants to open a new window typically expects it to be shown | 191 // Code that wants to open a new window typically expects it to be shown |
| 190 // automatically. | 192 // automatically. |
| 191 if (params->disposition == NEW_WINDOW || params->disposition == NEW_POPUP) { | 193 if (params->disposition == NEW_WINDOW || params->disposition == NEW_POPUP) { |
| 192 params->show_window = true; | 194 params->show_window = true; |
| 193 params->tabstrip_add_types |= TabStripModel::ADD_SELECTED; | 195 params->tabstrip_add_types |= TabStripModel::ADD_SELECTED; |
| 194 } | 196 } |
| 195 } | 197 } |
| 196 | 198 |
| 197 // This class makes sure the Browser object held in |params| is made visible | 199 // This class makes sure the Browser object held in |params| is made visible |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 params->transition, | 375 params->transition, |
| 374 params->tabstrip_add_types); | 376 params->tabstrip_add_types); |
| 375 // Now that the |params->target_contents| is safely owned by the target | 377 // Now that the |params->target_contents| is safely owned by the target |
| 376 // Browser's TabStripModel, we can release ownership. | 378 // Browser's TabStripModel, we can release ownership. |
| 377 target_contents_owner.ReleaseOwnership(); | 379 target_contents_owner.ReleaseOwnership(); |
| 378 } | 380 } |
| 379 } | 381 } |
| 380 } | 382 } |
| 381 | 383 |
| 382 } // namespace browser | 384 } // namespace browser |
| OLD | NEW |