OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_PREFS_SESSION_STARTUP_PREF_H__ | 5 #ifndef CHROME_BROWSER_PREFS_SESSION_STARTUP_PREF_H__ |
6 #define CHROME_BROWSER_PREFS_SESSION_STARTUP_PREF_H__ | 6 #define CHROME_BROWSER_PREFS_SESSION_STARTUP_PREF_H__ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
11 | 11 |
12 class PrefService; | 12 class PrefService; |
| 13 class PrefServiceSyncable; |
13 class Profile; | 14 class Profile; |
14 | 15 |
15 // StartupPref specifies what should happen at startup for a specified profile. | 16 // StartupPref specifies what should happen at startup for a specified profile. |
16 // StartupPref is stored in the preferences for a particular profile. | 17 // StartupPref is stored in the preferences for a particular profile. |
17 struct SessionStartupPref { | 18 struct SessionStartupPref { |
18 enum Type { | 19 enum Type { |
19 // Indicates the user wants to open the New Tab page. | 20 // Indicates the user wants to open the New Tab page. |
20 DEFAULT, | 21 DEFAULT, |
21 | 22 |
22 // Deprecated. See comment in session_startup_pref.cc | 23 // Deprecated. See comment in session_startup_pref.cc |
(...skipping 10 matching lines...) Expand all Loading... |
33 TYPE_COUNT | 34 TYPE_COUNT |
34 }; | 35 }; |
35 | 36 |
36 // For historical reasons the enum and value registered in the prefs don't | 37 // For historical reasons the enum and value registered in the prefs don't |
37 // line up. These are the values registered in prefs. | 38 // line up. These are the values registered in prefs. |
38 static const int kPrefValueHomePage = 0; // Deprecated | 39 static const int kPrefValueHomePage = 0; // Deprecated |
39 static const int kPrefValueLast = 1; | 40 static const int kPrefValueLast = 1; |
40 static const int kPrefValueURLs = 4; | 41 static const int kPrefValueURLs = 4; |
41 static const int kPrefValueNewTab = 5; | 42 static const int kPrefValueNewTab = 5; |
42 | 43 |
43 static void RegisterUserPrefs(PrefService* prefs); | 44 static void RegisterUserPrefs(PrefServiceSyncable* prefs); |
44 | 45 |
45 // Returns the default value for |type|. | 46 // Returns the default value for |type|. |
46 static Type GetDefaultStartupType(); | 47 static Type GetDefaultStartupType(); |
47 | 48 |
48 // What should happen on startup for the specified profile. | 49 // What should happen on startup for the specified profile. |
49 static void SetStartupPref(Profile* profile, const SessionStartupPref& pref); | 50 static void SetStartupPref(Profile* profile, const SessionStartupPref& pref); |
50 static void SetStartupPref(PrefService* prefs, | 51 static void SetStartupPref(PrefService* prefs, |
51 const SessionStartupPref& pref); | 52 const SessionStartupPref& pref); |
52 static SessionStartupPref GetStartupPref(Profile* profile); | 53 static SessionStartupPref GetStartupPref(Profile* profile); |
53 static SessionStartupPref GetStartupPref(PrefService* prefs); | 54 static SessionStartupPref GetStartupPref(PrefService* prefs); |
(...skipping 22 matching lines...) Expand all Loading... |
76 ~SessionStartupPref(); | 77 ~SessionStartupPref(); |
77 | 78 |
78 // What to do on startup. | 79 // What to do on startup. |
79 Type type; | 80 Type type; |
80 | 81 |
81 // The URLs to restore. Only used if type == URLS. | 82 // The URLs to restore. Only used if type == URLS. |
82 std::vector<GURL> urls; | 83 std::vector<GURL> urls; |
83 }; | 84 }; |
84 | 85 |
85 #endif // CHROME_BROWSER_PREFS_SESSION_STARTUP_PREF_H__ | 86 #endif // CHROME_BROWSER_PREFS_SESSION_STARTUP_PREF_H__ |
OLD | NEW |