diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-26 15:58:08 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-26 15:58:08 +0000 |
commit | c9b19949487f406436c9f5cdfdf35ce3bd805d67 (patch) | |
tree | 0de3a25b34c84b1dcdbd84ae7205ca3a514fec7f /chrome/browser/sessions/session_service.h | |
parent | fdeb7ac65e407aa5334b6f5308f15be3dae70dd6 (diff) | |
download | chromium_src-c9b19949487f406436c9f5cdfdf35ce3bd805d67.zip chromium_src-c9b19949487f406436c9f5cdfdf35ce3bd805d67.tar.gz chromium_src-c9b19949487f406436c9f5cdfdf35ce3bd805d67.tar.bz2 |
Fixes bug where triggering session restore while the browser was
already running would end up creating an extra tab.
BUG=11594
TEST=open chrome with a single tabbed browser, turn on session
restore, navigate to a page with a popup, close the tabbed browser,
create a new window ala control-n (or double click on the desktop),
and make the restored window doesn't end upw
Review URL: http://codereview.chromium.org/1371002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42766 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sessions/session_service.h')
-rw-r--r-- | chrome/browser/sessions/session_service.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/chrome/browser/sessions/session_service.h b/chrome/browser/sessions/session_service.h index a950224..278c94b 100644 --- a/chrome/browser/sessions/session_service.h +++ b/chrome/browser/sessions/session_service.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -53,6 +53,13 @@ class SessionService : public BaseSessionService, // For testing. explicit SessionService(const FilePath& save_path); + // Invoke at a point when you think session restore might occur. For example, + // during startup and window creation this is invoked to see if a session + // needs to be restored. If a session needs to be restored it is done so + // asynchronously and true is returned. If false is returned the session was + // not restored and the caller needs to create a new window. + bool RestoreIfNecessary(const std::vector<GURL>& urls_to_open); + // Resets the contents of the file from the current state of all open // browsers whose profile matches our profile. void ResetFromCurrentBrowsers(); @@ -180,6 +187,11 @@ class SessionService : public BaseSessionService, void Init(); + // Implementation of RestoreIfNecessary. If |browser| is non-null and we need + // to restore, the tabs are added to it, otherwise a new browser is created. + bool RestoreIfNecessary(const std::vector<GURL>& urls_to_open, + Browser* browser); + virtual void Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details); |