1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_SESSION_RESTORE_H__
6 #define CHROME_BROWSER_SESSION_RESTORE_H__
10 #include "chrome/browser/history/history.h"
11 #include "base/basictypes.h"
16 // SessionRestore handles restoring either the last or saved session. Session
17 // restore come in two variants, asynchronous or synchronous. The synchronous
18 // variety is meant for startup, and blocks until restore is complete.
19 class SessionRestore
{
21 // Asnchronously restores the specified session.
22 // If clobber_existing_window is true and there is an open browser window,
23 // it is closed after restoring.
24 // If always_create_tabbed_browser is true at least one tabbed browser is
25 // created. For example, if there is an error restoring, or the last session
26 // session is empty and always_create_tabbed_browser is true, a new empty
27 // tabbed browser is created.
29 // If urls_to_open is non-empty, a tab is added for each of the URLs.
30 static void RestoreSession(Profile
* profile
,
31 bool use_saved_session
,
32 bool clobber_existing_window
,
33 bool always_create_tabbed_browser
,
34 const std::vector
<GURL
>& urls_to_open
);
36 // Synchronously restores the last session. At least one tabbed browser is
37 // created, even if there is an error in restoring.
39 // If urls_to_open is non-empty, a tab is added for each of the URLs.
40 static void RestoreSessionSynchronously(
42 bool use_saved_session
,
44 const std::vector
<GURL
>& urls_to_open
);
46 // The max number of non-selected tabs SessionRestore loads when restoring
47 // a session. A value of 0 indicates all tabs are loaded at once.
48 static size_t num_tabs_to_load_
;
53 DISALLOW_EVIL_CONSTRUCTORS(SessionRestore
);
56 #endif // CHROME_BROWSER_SESSION_RESTORE_H__