blob: 4cf8a78d9db89498f80ef02a3a379a353834eea9 [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);
[email protected]d3216442009-03-05 21:07:2734 static void SetStartupPref(PrefService* prefs,
35 const SessionStartupPref& pref);
initial.commit09911bf2008-07-26 23:55:2936 static SessionStartupPref GetStartupPref(Profile* profile);
37 static SessionStartupPref GetStartupPref(PrefService* prefs);
38
39 SessionStartupPref() : type(DEFAULT) {}
40
41 explicit SessionStartupPref(Type type) : type(type) {}
42
43 // What to do on startup.
44 Type type;
45
46 // The URLs to restore. Only used if type == URLS.
47 std::vector<GURL> urls;
48};
49
50#endif // CHROME_BROWSER_SESSION_STARTUP_PREF_H__