diff options
author | pam@chromium.org <pam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-22 20:03:08 +0000 |
---|---|---|
committer | pam@chromium.org <pam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-22 20:03:08 +0000 |
commit | c714a16415946fe384b4ba341fc67697b9e79af3 (patch) | |
tree | ff4093e3bc03e592f0a6ac804562aadaea2eb977 /chrome/browser/sessions/tab_restore_service.h | |
parent | f74c89669d1c2406e6af03a84eacc18e3c775547 (diff) | |
download | chromium_src-c714a16415946fe384b4ba341fc67697b9e79af3.zip chromium_src-c714a16415946fe384b4ba341fc67697b9e79af3.tar.gz chromium_src-c714a16415946fe384b4ba341fc67697b9e79af3.tar.bz2 |
Restore closed tabs into new windows when necessary, and track the windows they
came from so they're restored together (into the same new window) when
appropriate.
Fix safety check on tab index when restoring: make it check the correct
browser.
Change some ASSERTs to EXPECTs in the unit test for greater coverage.
BUG=5278
TEST=Open a window with two tabs, close both (closing the window), then
restore both. Make sure both restored tabs are in the same window. Open
a window with multiple tabs, close a tab, then close the window using
its close box. Restore both and make sure the tab goes back into the window.
Review URL: http://codereview.chromium.org/92001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14234 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sessions/tab_restore_service.h')
-rw-r--r-- | chrome/browser/sessions/tab_restore_service.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/chrome/browser/sessions/tab_restore_service.h b/chrome/browser/sessions/tab_restore_service.h index c728652..6b1da34 100644 --- a/chrome/browser/sessions/tab_restore_service.h +++ b/chrome/browser/sessions/tab_restore_service.h @@ -168,9 +168,11 @@ class TabRestoreService : public BaseSessionService { LOADED_LAST_SESSION = 1 << 4 }; - // Populates tabs->navigations from the NavigationController. - void PopulateTabFromController(NavigationController* controller, - Tab* tab); + // Populates the tab's navigations from the NavigationController, and its + // browser_id and tabstrip_index from the browser. + void PopulateTab(Tab* tab, + Browser* browser, + NavigationController* controller); // Notifies observers the tabs have changed. void NotifyTabsChanged(); @@ -235,6 +237,10 @@ class TabRestoreService : public BaseSessionService { // hold. void ValidateAndDeleteEmptyEntries(std::vector<Entry*>* entries); + // Finds tab entries with the old browser_id and sets it to the new one. + void UpdateTabBrowserIDs(SessionID::id_type old_id, + SessionID::id_type new_id); + // Callback from SessionService when we've received the windows from the // previous session. This creates and add entries to |staging_entries_| // and invokes LoadStateChanged. |