summaryrefslogtreecommitdiffstats
path: root/chrome/browser/session_service.h
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-30 02:58:36 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-30 02:58:36 +0000
commit6ea265a8b1b6e1512992945efa08942f575ad4c1 (patch)
tree5b58bd5a7f6f599db9e08435965fb81ca54c4930 /chrome/browser/session_service.h
parent5ffd5e9b703d122dbac2dce9425a88b414f6de97 (diff)
downloadchromium_src-6ea265a8b1b6e1512992945efa08942f575ad4c1.zip
chromium_src-6ea265a8b1b6e1512992945efa08942f575ad4c1.tar.gz
chromium_src-6ea265a8b1b6e1512992945efa08942f575ad4c1.tar.bz2
Changes session restore to account for apps and popups. If you have
session restore enabled any time you transition from no tabbed browsers to a tabbed browser (in the same profile) we restore your last session, where the last session was any previously open tabbed browsers. For example, if you start Chrome from an installed app shortcut then create a new tabbed browser (by any means) we'll restore your last session. This gives the illustion that apps are running in their own process. I would love to have test coverage of this, but I'm loathe to write anymore flakey UI tests. Need to revisit post 1.0. BUG=1883 TEST=thoroughly test session restore, especially with application shortcuts and popups. Review URL: http://codereview.chromium.org/8856 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4202 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/session_service.h')
-rw-r--r--chrome/browser/session_service.h30
1 files changed, 17 insertions, 13 deletions
diff --git a/chrome/browser/session_service.h b/chrome/browser/session_service.h
index 9918605..68b6c74b 100644
--- a/chrome/browser/session_service.h
+++ b/chrome/browser/session_service.h
@@ -165,15 +165,22 @@ struct SessionWindow {
// SessionService ------------------------------------------------------------
// SessionService is responsible for maintaining the state of open windows
-// and tabs so that they can be restored at a later date.
+// and tabs so that they can be restored at a later date. The state of the
+// currently open browsers is referred to as the current session.
//
-// SessionService supports restoring from two distinct points:
-// . The last run of the browser.
+// SessionService supports restoring from two distinct points (or sessions):
+// . The previous or last session. The previous session typically corresponds
+// to the last run of the browser, but not always. For example, if the user
+// has a tabbed browser and app window running, closes the tabbed browser,
+// then creates a new tabbed browser the current session is made the last
+// session and the current session reset. This is done to provide the
+// illusion that app windows run in separate processes.
// . A user defined point. That is, any time CreateSavedSession is invoked
// the save session is reset from the current state of the browser.
//
// Additionally the current session can be made the 'last' session at any point
-// by way of MoveCurrentSessionToLastSession.
+// by way of MoveCurrentSessionToLastSession. This may be done at certain points
+// during the browser that are viewed as changing the
//
// SessionService itself maintains a set of SessionCommands that allow
// SessionService to rebuild the open state of the browser (as
@@ -194,12 +201,6 @@ class SessionService : public CancelableRequestProvider,
~SessionService();
- // Returns true if there are any open tabbed browser windows.
- bool has_open_tabbed_browsers() const { return has_open_tabbed_browsers_; }
-
- // Returns true if a tabbed browser has ever been created.
- bool tabbed_browser_created() const { return tabbed_browser_created_; }
-
// Resets the contents of the file from the current state of all open
// browsers whose profile matches our profile.
void ResetFromCurrentBrowsers();
@@ -547,7 +548,7 @@ class SessionService : public CancelableRequestProvider,
// Used to invoke Save.
ScopedRunnableMethodFactory<SessionService> save_factory_;
- // When the user closes the last window, where the last window is the the
+ // When the user closes the last window, where the last window is the
// last tabbed browser and no more tabbed browsers are open with the same
// profile, the window ID is added here. These IDs are only committed (which
// marks them as closed) if the user creates a new tabbed browser.
@@ -579,8 +580,11 @@ class SessionService : public CancelableRequestProvider,
// Are there any open open tabbed browsers?
bool has_open_tabbed_browsers_;
- // Was a tabbed browser ever created?
- bool tabbed_browser_created_;
+ // If true and a new tabbed browser is created and there are no opened tabbed
+ // browser (has_open_tabbed_browsers_ is false), then the current session
+ // is made the previous session. See description above class for details on
+ // current/previou session.
+ bool move_on_new_browser_;
};
#endif // CHROME_BROWSER_SESSION_SERVICE_H__