diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-05 03:55:05 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-05 03:55:05 +0000 |
commit | 97d2c1ead3b1dfc2f40f0de9123a3d0ed5edff23 (patch) | |
tree | 22f9cdc287f64dbc1f7397264e110d001d963c31 /chrome/browser/sessions/session_service.h | |
parent | 7e5e9d2e535109d83b5c94aa928c397ce3b9bcc0 (diff) | |
download | chromium_src-97d2c1ead3b1dfc2f40f0de9123a3d0ed5edff23.zip chromium_src-97d2c1ead3b1dfc2f40f0de9123a3d0ed5edff23.tar.gz chromium_src-97d2c1ead3b1dfc2f40f0de9123a3d0ed5edff23.tar.bz2 |
Make SessionService use its own enum for storing window type in the session database. This allows us to modify Browser::Type without invalidating databases from older versions.
http://crbug.com/26500
TEST=see bug
Review URL: http://codereview.chromium.org/361016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31069 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sessions/session_service.h')
-rw-r--r-- | chrome/browser/sessions/session_service.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/chrome/browser/sessions/session_service.h b/chrome/browser/sessions/session_service.h index 7fddaaa..d1b5f05 100644 --- a/chrome/browser/sessions/session_service.h +++ b/chrome/browser/sessions/session_service.h @@ -154,6 +154,16 @@ class SessionService : public BaseSessionService, typedef std::map<SessionID::id_type,SessionTab*> IdToSessionTab; typedef std::map<SessionID::id_type,SessionWindow*> IdToSessionWindow; + // These types mirror Browser::Type, but are re-defined here because these + // specific enumeration _values_ are written into the session database and + // are needed to maintain forward compatibility. + enum WindowType { + TYPE_NORMAL = 0, + TYPE_POPUP = 1, + TYPE_APP = 2, + TYPE_APP_POPUP = TYPE_APP + TYPE_POPUP + }; + void Init(); virtual void Observe(NotificationType type, @@ -184,7 +194,7 @@ class SessionService : public BaseSessionService, int index); SessionCommand* CreateSetWindowTypeCommand(const SessionID& window_id, - Browser::Type type); + WindowType type); SessionCommand* CreatePinnedStateCommand(const SessionID& tab_id, bool is_pinned); @@ -320,6 +330,11 @@ class SessionService : public BaseSessionService, (type == Browser::TYPE_POPUP && browser_defaults::kRestorePopups); } + // Convert back/forward between the Browser and SessionService DB window + // types. + static WindowType WindowTypeForBrowserType(Browser::Type type); + static Browser::Type BrowserTypeForWindowType(WindowType type); + NotificationRegistrar registrar_; // Maps from session tab id to the range of navigation entries that has |