| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include "base/gfx/point.h" | 7 #include "base/gfx/point.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "chrome/browser/browser.h" | 9 #include "chrome/browser/browser.h" |
| 10 #include "chrome/browser/browser_about_handler.h" | 10 #include "chrome/browser/browser_about_handler.h" |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 | 327 |
| 328 bool TabStripModel::ShouldResetGroupOnSelect(TabContents* contents) const { | 328 bool TabStripModel::ShouldResetGroupOnSelect(TabContents* contents) const { |
| 329 int index = GetIndexOfTabContents(contents); | 329 int index = GetIndexOfTabContents(contents); |
| 330 DCHECK(ContainsIndex(index)); | 330 DCHECK(ContainsIndex(index)); |
| 331 return contents_data_.at(index)->reset_group_on_select; | 331 return contents_data_.at(index)->reset_group_on_select; |
| 332 } | 332 } |
| 333 | 333 |
| 334 TabContents* TabStripModel::AddBlankTab(bool foreground) { | 334 TabContents* TabStripModel::AddBlankTab(bool foreground) { |
| 335 DCHECK(delegate_); | 335 DCHECK(delegate_); |
| 336 TabContents* contents = delegate_->CreateTabContentsForURL( | 336 TabContents* contents = delegate_->CreateTabContentsForURL( |
| 337 NewTabUIURL(), profile_, PageTransition::TYPED, false, NULL); | 337 NewTabUIURL(), GURL(), profile_, PageTransition::TYPED, false, NULL); |
| 338 AddTabContents(contents, -1, PageTransition::TYPED, foreground); | 338 AddTabContents(contents, -1, PageTransition::TYPED, foreground); |
| 339 return contents; | 339 return contents; |
| 340 } | 340 } |
| 341 | 341 |
| 342 TabContents* TabStripModel::AddBlankTabAt(int index, bool foreground) { | 342 TabContents* TabStripModel::AddBlankTabAt(int index, bool foreground) { |
| 343 DCHECK(delegate_); | 343 DCHECK(delegate_); |
| 344 TabContents* contents = delegate_->CreateTabContentsForURL( | 344 TabContents* contents = delegate_->CreateTabContentsForURL( |
| 345 NewTabUIURL(), profile_, PageTransition::LINK, false, NULL); | 345 NewTabUIURL(), GURL(), profile_, PageTransition::LINK, false, NULL); |
| 346 AddTabContents(contents, index, PageTransition::LINK, foreground); | 346 AddTabContents(contents, index, PageTransition::LINK, foreground); |
| 347 return contents; | 347 return contents; |
| 348 } | 348 } |
| 349 | 349 |
| 350 void TabStripModel::AddTabContents(TabContents* contents, | 350 void TabStripModel::AddTabContents(TabContents* contents, |
| 351 int index, | 351 int index, |
| 352 PageTransition::Type transition, | 352 PageTransition::Type transition, |
| 353 bool foreground) { | 353 bool foreground) { |
| 354 if (transition == PageTransition::LINK) { | 354 if (transition == PageTransition::LINK) { |
| 355 // Only try to be clever if we're opening a LINK. | 355 // Only try to be clever if we're opening a LINK. |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 } | 605 } |
| 606 | 606 |
| 607 // static | 607 // static |
| 608 bool TabStripModel::OpenerMatches(TabContentsData* data, | 608 bool TabStripModel::OpenerMatches(TabContentsData* data, |
| 609 NavigationController* opener, | 609 NavigationController* opener, |
| 610 bool use_group) { | 610 bool use_group) { |
| 611 return data->opener == opener || (use_group && data->group == opener); | 611 return data->opener == opener || (use_group && data->group == opener); |
| 612 } | 612 } |
| 613 | 613 |
| 614 | 614 |
| OLD | NEW |