diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-25 09:29:09 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-25 09:29:09 +0000 |
commit | daa095c134fd55a8ab8b0d02d3f7a164f2e51bc5 (patch) | |
tree | 480e85767d651f45189160a9eb22b7fd5c50a8ff | |
parent | 854d18eff9e16adb1e3df9e187d5596ce3fd8bd9 (diff) | |
download | chromium_src-daa095c134fd55a8ab8b0d02d3f7a164f2e51bc5.zip chromium_src-daa095c134fd55a8ab8b0d02d3f7a164f2e51bc5.tar.gz chromium_src-daa095c134fd55a8ab8b0d02d3f7a164f2e51bc5.tar.bz2 |
Kill TabStripModel::ReplaceNavigationControllerAt.
BUG=none
TEST=none
Review URL: https://chromiumcodereview.appspot.com/11275018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164034 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/ui/browser_tabrestore.cc | 11 | ||||
-rw-r--r-- | chrome/browser/ui/tabs/tab_strip_model.cc | 11 | ||||
-rw-r--r-- | chrome/browser/ui/tabs/tab_strip_model.h | 11 |
3 files changed, 8 insertions, 25 deletions
diff --git a/chrome/browser/ui/browser_tabrestore.cc b/chrome/browser/ui/browser_tabrestore.cc index b19e187..29b4da9 100644 --- a/chrome/browser/ui/browser_tabrestore.cc +++ b/chrome/browser/ui/browser_tabrestore.cc @@ -147,9 +147,14 @@ void ReplaceRestoredTab( &entries); DCHECK_EQ(0u, entries.size()); - browser->tab_strip_model()->ReplaceNavigationControllerAt( - browser->active_index(), - tab_contents); + // ReplaceTabContentsAt won't animate in the restoration, so do it manually. + int insertion_index = browser->active_index(); + browser->tab_strip_model()->InsertTabContentsAt( + insertion_index + 1, + tab_contents, + TabStripModel::ADD_ACTIVE | TabStripModel::ADD_INHERIT_GROUP); + browser->tab_strip_model()->CloseTabContentsAt( + insertion_index, TabStripModel::CLOSE_NONE); } } // namespace chrome diff --git a/chrome/browser/ui/tabs/tab_strip_model.cc b/chrome/browser/ui/tabs/tab_strip_model.cc index ded9ac1..23b489d 100644 --- a/chrome/browser/ui/tabs/tab_strip_model.cc +++ b/chrome/browser/ui/tabs/tab_strip_model.cc @@ -192,17 +192,6 @@ TabContents* TabStripModel::ReplaceTabContentsAt(int index, return old_contents; } -void TabStripModel::ReplaceNavigationControllerAt( - int index, TabContents* contents) { - // This appears to be OK with no flicker since no redraw event - // occurs between the call to add an additional tab and one to close - // the previous tab. - InsertTabContentsAt(index + 1, contents, ADD_ACTIVE | ADD_INHERIT_GROUP); - std::vector<int> closing_tabs; - closing_tabs.push_back(index); - InternalCloseTabs(closing_tabs, CLOSE_NONE); -} - TabContents* TabStripModel::DiscardTabContentsAt(int index) { DCHECK(ContainsIndex(index)); // Do not discard active tab. diff --git a/chrome/browser/ui/tabs/tab_strip_model.h b/chrome/browser/ui/tabs/tab_strip_model.h index f69be89..82d4863 100644 --- a/chrome/browser/ui/tabs/tab_strip_model.h +++ b/chrome/browser/ui/tabs/tab_strip_model.h @@ -205,17 +205,6 @@ class TabStripModel : public content::NotificationObserver { // user to confirm closure). bool CloseTabContentsAt(int index, uint32 close_types); - // Replaces the entire state of a the tab at index by switching in a - // different NavigationController. This is used through the recently - // closed tabs list, which needs to replace a tab's current state - // and history with another set of contents and history. - // - // The old NavigationController is deallocated and this object takes - // ownership of the passed in controller. - // XXXPINK This API is weird and wrong. Remove it or change it or rename it? - void ReplaceNavigationControllerAt(int index, - TabContents* contents); - // Replaces the tab contents at |index| with |new_contents|. The // TabContents that was at |index| is returned and ownership returns // to the caller. |