blob: 8a405796c126ec4eaa7be7d3648fda38a67c47d6 [file] [log] [blame]
license.botbf09a502008-08-24 00:55:551// 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.
initial.commit09911bf2008-07-26 23:55:294
5#ifndef CHROME_BROWSER_SESSION_STARTUP_PREF_H__
6#define CHROME_BROWSER_SESSION_STARTUP_PREF_H__
7
8#include <vector>
9
10#include "googleurl/src/gurl.h"
11
12class PrefService;
13class Profile;
14
15// StartupPref specifies what should happen at startup for a specified profile.
16// StartupPref is stored in the preferences for a particular profile.
17struct SessionStartupPref {
18 enum Type {
19 // Indicates the user doesn't want to restore a previous session.
20 DEFAULT,
21
22 // Indicates the user wants to restore the last session.
23 LAST,
24
25 // Indicates the user wants to restore a specific set of URLs. The URLs
26 // are contained in urls.
27 URLS
28 };
29
30 static void RegisterUserPrefs(PrefService* prefs);
31
32 // What should happen on startup for the specified profile.
33 static void SetStartupPref(Profile* profile, const SessionStartupPref& pref);
34 static void SetStartupPref(PrefService* prefs, const SessionStartupPref& pref);
35 static SessionStartupPref GetStartupPref(Profile* profile);
36 static SessionStartupPref GetStartupPref(PrefService* prefs);
37
38 SessionStartupPref() : type(DEFAULT) {}
39
40 explicit SessionStartupPref(Type type) : type(type) {}
41
42 // What to do on startup.
43 Type type;
44
45 // The URLs to restore. Only used if type == URLS.
46 std::vector<GURL> urls;
47};
48
49#endif // CHROME_BROWSER_SESSION_STARTUP_PREF_H__
license.botbf09a502008-08-24 00:55:5550