Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4897)

Unified Diff: chrome/browser/tabs/tab_strip_model.cc

Issue 5610005: Makes instant run before unload listeners. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome
Patch Set: Fix comments and reset session id appropriately Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/tabs/tab_strip_model.h ('k') | chrome/browser/tabs/tab_strip_model_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tabs/tab_strip_model.cc
diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc
index 70287c9465c1702dc0c1e0f9fd1dd7a5c86e5e54..10fd04476c96f5b1159611f60f29f944c824b2be 100644
--- a/chrome/browser/tabs/tab_strip_model.cc
+++ b/chrome/browser/tabs/tab_strip_model.cc
@@ -165,26 +165,28 @@ void TabStripModel::InsertTabContentsAt(int index,
ChangeSelectedContentsFrom(selected_contents, index, false);
}
-void TabStripModel::ReplaceTabContentsAt(int index,
- TabContentsWrapper* new_contents) {
+TabContentsWrapper* TabStripModel::ReplaceTabContentsAt(
+ int index,
+ TabContentsWrapper* new_contents) {
// TODO: this should reset group/opener of any tabs that point at
// old_contents.
DCHECK(ContainsIndex(index));
- scoped_ptr<TabContentsWrapper> old_contents(GetContentsAt(index));
+ TabContentsWrapper* old_contents = GetContentsAt(index);
contents_data_[index]->contents = new_contents;
FOR_EACH_OBSERVER(TabStripModelObserver, observers_,
- TabReplacedAt(old_contents.get(), new_contents, index));
+ TabReplacedAt(old_contents, 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
// selected contents as selection changing.
if (selected_index_ == index) {
FOR_EACH_OBSERVER(TabStripModelObserver, observers_,
- TabSelectedAt(old_contents.get(), new_contents,
+ TabSelectedAt(old_contents, new_contents,
selected_index_, false));
}
+ return old_contents;
}
void TabStripModel::ReplaceNavigationControllerAt(
« no previous file with comments | « chrome/browser/tabs/tab_strip_model.h ('k') | chrome/browser/tabs/tab_strip_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698