diff options
author | andybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-06 17:43:35 +0000 |
---|---|---|
committer | andybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-06 17:43:35 +0000 |
commit | 4ee5bfeeb8ff41f0d036cd2964929b76cee2d75b (patch) | |
tree | ecbec53f1398e4c4eeb93617261984751457dc7c /chrome/browser/tabs | |
parent | 9f73b7fac0fa59eea92731b3919f1a1335acb7af (diff) | |
download | chromium_src-4ee5bfeeb8ff41f0d036cd2964929b76cee2d75b.zip chromium_src-4ee5bfeeb8ff41f0d036cd2964929b76cee2d75b.tar.gz chromium_src-4ee5bfeeb8ff41f0d036cd2964929b76cee2d75b.tar.bz2 |
Address sky's post-commit comments for my phantom tab removal change.
o Consolidate ReplaceTabContentsAtImpl into ReplaceTabContentsAt since there is only one caller to the former.
o Removal of a TODO.
The original change is http://crrev.com/61303
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3543012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61670 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tabs')
-rw-r--r-- | chrome/browser/tabs/tab_strip_model.cc | 27 | ||||
-rw-r--r-- | chrome/browser/tabs/tab_strip_model.h | 4 | ||||
-rw-r--r-- | chrome/browser/tabs/tab_strip_model_observer.h | 1 |
3 files changed, 9 insertions, 23 deletions
diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc index 1f7a668..e06b3f3 100644 --- a/chrome/browser/tabs/tab_strip_model.cc +++ b/chrome/browser/tabs/tab_strip_model.cc @@ -163,8 +163,15 @@ void TabStripModel::InsertTabContentsAt(int index, } void TabStripModel::ReplaceTabContentsAt(int index, TabContents* new_contents) { - scoped_ptr<TabContents> old_contents( - ReplaceTabContentsAtImpl(index, new_contents)); + // TODO: this should reset group/opener of any tabs that point at + // old_contents. + DCHECK(ContainsIndex(index)); + scoped_ptr<TabContents> old_contents(GetContentsAt(index)); + + contents_data_[index]->contents = new_contents; + + FOR_EACH_OBSERVER(TabStripModelObserver, observers_, + TabReplacedAt(old_contents.get(), new_contents, index)); // When the selected tab contents is replaced send out selected notification // too. We do this as nearly all observers need to treat a replace of the @@ -925,19 +932,3 @@ bool TabStripModel::OpenerMatches(const TabContentsData* data, bool use_group) { return data->opener == opener || (use_group && data->group == opener); } - -TabContents* TabStripModel::ReplaceTabContentsAtImpl( - int index, - TabContents* new_contents) { - // TODO: this should reset group/opener of any tabs that point at - // old_contents. - DCHECK(ContainsIndex(index)); - - TabContents* old_contents = GetContentsAt(index); - - contents_data_[index]->contents = new_contents; - - FOR_EACH_OBSERVER(TabStripModelObserver, observers_, - TabReplacedAt(old_contents, new_contents, index)); - return old_contents; -} diff --git a/chrome/browser/tabs/tab_strip_model.h b/chrome/browser/tabs/tab_strip_model.h index 5b58afc..3e7a98d 100644 --- a/chrome/browser/tabs/tab_strip_model.h +++ b/chrome/browser/tabs/tab_strip_model.h @@ -462,10 +462,6 @@ class TabStripModel : public NotificationObserver { const NavigationController* opener, bool use_group); - // Does the work for ReplaceTabContentsAt returning the old TabContents. - // The caller owns the returned TabContents. - TabContents* ReplaceTabContentsAtImpl(int index, TabContents* new_contents); - // Our delegate. TabStripModelDelegate* delegate_; diff --git a/chrome/browser/tabs/tab_strip_model_observer.h b/chrome/browser/tabs/tab_strip_model_observer.h index 931497b..9a091ee 100644 --- a/chrome/browser/tabs/tab_strip_model_observer.h +++ b/chrome/browser/tabs/tab_strip_model_observer.h @@ -84,7 +84,6 @@ class TabStripModelObserver { // The tab contents was replaced at the specified index. This is invoked when // a tab becomes phantom. See description of phantom tabs in class description // of TabStripModel for details. - // TODO(sky): nuke this in favor of the 4 arg variant. virtual void TabReplacedAt(TabContents* old_contents, TabContents* new_contents, int index); |