summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-05 22:31:23 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-05 22:31:23 +0000
commite1f8c2fb0a279441f99449084be34271334b9d15 (patch)
treef4f59814b05799557471a4859ca2b22a94263362
parenta1425a52446f61c86af9956f2aea6b4c4c7cc814 (diff)
downloadchromium_src-e1f8c2fb0a279441f99449084be34271334b9d15.zip
chromium_src-e1f8c2fb0a279441f99449084be34271334b9d15.tar.gz
chromium_src-e1f8c2fb0a279441f99449084be34271334b9d15.tar.bz2
Clicking on restore window button on ntp now nukes ntp. We always did
this for tabs, just not windows. BUG=21316 TEST=see bug Review URL: http://codereview.chromium.org/360060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31146 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/sessions/tab_restore_service.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/chrome/browser/sessions/tab_restore_service.cc b/chrome/browser/sessions/tab_restore_service.cc
index 339aeb3..dc7b7b5 100644
--- a/chrome/browser/sessions/tab_restore_service.cc
+++ b/chrome/browser/sessions/tab_restore_service.cc
@@ -283,6 +283,7 @@ void TabRestoreService::RestoreEntryById(Browser* browser,
tab->pinned, tab->from_last_session);
}
} else if (entry->type == WINDOW) {
+ Browser* current_browser = browser;
const Window* window = static_cast<Window*>(entry);
browser = Browser::Create(profile());
for (size_t tab_i = 0; tab_i < window->tabs.size(); ++tab_i) {
@@ -302,6 +303,11 @@ void TabRestoreService::RestoreEntryById(Browser* browser,
browser->session_id().id());
}
browser->window()->Show();
+
+ if (replace_existing_tab && current_browser &&
+ current_browser->GetSelectedTabContents()) {
+ current_browser->CloseTab();
+ }
} else {
NOTREACHED();
}