diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-06 08:50:23 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-06 08:50:23 +0000 |
commit | 5bf053ef488c81f6ec822de35cab79188c74f9dd (patch) | |
tree | 0cef89cb7594a5805fd67633fe60b6bf3d675417 /chrome/browser/tabs | |
parent | db6f5f898d9513d94efb1b066e972715e8d38e83 (diff) | |
download | chromium_src-5bf053ef488c81f6ec822de35cab79188c74f9dd.zip chromium_src-5bf053ef488c81f6ec822de35cab79188c74f9dd.tar.gz chromium_src-5bf053ef488c81f6ec822de35cab79188c74f9dd.tar.bz2 |
Change Browser::GetIndexOfController to GetIndexOfTabContents. Now that we
don't have tab contents switching, identifying tabs by their controller is
weird, so we should gradually move to only using TabContents*.
Review URL: http://codereview.chromium.org/115018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15399 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tabs')
-rw-r--r-- | chrome/browser/tabs/tab_strip_model.cc | 11 | ||||
-rw-r--r-- | chrome/browser/tabs/tab_strip_model.h | 4 | ||||
-rw-r--r-- | chrome/browser/tabs/tab_strip_model_order_controller.cc | 2 | ||||
-rw-r--r-- | chrome/browser/tabs/tab_strip_model_unittest.cc | 2 |
4 files changed, 1 insertions, 18 deletions
diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc index e1a93f3..58b15f5 100644 --- a/chrome/browser/tabs/tab_strip_model.cc +++ b/chrome/browser/tabs/tab_strip_model.cc @@ -199,17 +199,6 @@ int TabStripModel::GetIndexOfTabContents(const TabContents* contents) const { return kNoTab; } -int TabStripModel::GetIndexOfController( - const NavigationController* controller) const { - int index = 0; - TabContentsDataVector::const_iterator iter = contents_data_.begin(); - for (; iter != contents_data_.end(); ++iter, ++index) { - if (&(*iter)->contents->controller() == controller) - return index; - } - return kNoTab; -} - void TabStripModel::UpdateTabContentsStateAt(int index, bool loading_only) { DCHECK(ContainsIndex(index)); diff --git a/chrome/browser/tabs/tab_strip_model.h b/chrome/browser/tabs/tab_strip_model.h index 7f496c8..266860c 100644 --- a/chrome/browser/tabs/tab_strip_model.h +++ b/chrome/browser/tabs/tab_strip_model.h @@ -306,10 +306,6 @@ class TabStripModel : public NotificationObserver { // is not in this TabStripModel. int GetIndexOfTabContents(const TabContents* contents) const; - // Returns the index of the specified NavigationController, or -1 if it is - // not in this TabStripModel. - int GetIndexOfController(const NavigationController* controller) const; - // Notify any observers that the TabContents at the specified index has // changed in some way. Loading only specifies whether only the loading state // has changed. diff --git a/chrome/browser/tabs/tab_strip_model_order_controller.cc b/chrome/browser/tabs/tab_strip_model_order_controller.cc index 1db0525..70530b0 100644 --- a/chrome/browser/tabs/tab_strip_model_order_controller.cc +++ b/chrome/browser/tabs/tab_strip_model_order_controller.cc @@ -78,7 +78,7 @@ int TabStripModelOrderController::DetermineNewSelectedIndex( // If we can't find a subsequent group member, just fall back to the // parent_opener itself. Note that we use "group" here since opener is // reset by select operations.. - index = tabstrip_->GetIndexOfController(parent_opener); + index = tabstrip_->GetIndexOfTabContents(parent_opener->tab_contents()); if (index != TabStripModel::kNoTab) return GetValidIndex(index, removing_index); } diff --git a/chrome/browser/tabs/tab_strip_model_unittest.cc b/chrome/browser/tabs/tab_strip_model_unittest.cc index a5b63a7..6e2dd80 100644 --- a/chrome/browser/tabs/tab_strip_model_unittest.cc +++ b/chrome/browser/tabs/tab_strip_model_unittest.cc @@ -372,8 +372,6 @@ TEST_F(TabStripModelTest, TestBasicAPI) { EXPECT_EQ(contents1, tabstrip.GetTabContentsAt(1)); EXPECT_EQ(0, tabstrip.GetIndexOfTabContents(contents2)); EXPECT_EQ(1, tabstrip.GetIndexOfTabContents(contents1)); - EXPECT_EQ(0, tabstrip.GetIndexOfController(&contents2->controller())); - EXPECT_EQ(1, tabstrip.GetIndexOfController(&contents1->controller())); } // Test UpdateTabContentsStateAt |