summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sessions/session_service.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/sessions/session_service.h')
-rw-r--r--chrome/browser/sessions/session_service.h14
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);