license.bot | bf09a50 | 2008-08-24 00:55:55 | [diff] [blame] | 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. |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 4 | |
| 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 | |
| 12 | class PrefService; |
| 13 | class 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. |
| 17 | struct 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] | d321644 | 2009-03-05 21:07:27 | [diff] [blame] | 34 | static void SetStartupPref(PrefService* prefs, |
| 35 | const SessionStartupPref& pref); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 36 | 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__ |