Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Unified Diff: chrome/browser/sessions/session_service.h

Issue 1371002: Fixes bug where triggering session restore while the browser was... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sessions/session_service.h
===================================================================
--- chrome/browser/sessions/session_service.h (revision 42688)
+++ chrome/browser/sessions/session_service.h (working copy)
@@ -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 @@
// 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 @@
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);

Powered by Google App Engine
This is Rietveld 408576698