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 PrefRegistrySyncable; |
14 class Profile; | 14 class Profile; |
15 | 15 |
16 // StartupPref specifies what should happen at startup for a specified profile. | 16 // StartupPref specifies what should happen at startup for a specified profile. |
17 // StartupPref is stored in the preferences for a particular profile. | 17 // StartupPref is stored in the preferences for a particular profile. |
18 struct SessionStartupPref { | 18 struct SessionStartupPref { |
19 enum Type { | 19 enum Type { |
20 // Indicates the user wants to open the New Tab page. | 20 // Indicates the user wants to open the New Tab page. |
21 DEFAULT, | 21 DEFAULT, |
22 | 22 |
23 // Deprecated. See comment in session_startup_pref.cc | 23 // Deprecated. See comment in session_startup_pref.cc |
(...skipping 10 matching lines...) Expand all Loading... |
34 TYPE_COUNT | 34 TYPE_COUNT |
35 }; | 35 }; |
36 | 36 |
37 // 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 |
38 // line up. These are the values registered in prefs. | 38 // line up. These are the values registered in prefs. |
39 static const int kPrefValueHomePage = 0; // Deprecated | 39 static const int kPrefValueHomePage = 0; // Deprecated |
40 static const int kPrefValueLast = 1; | 40 static const int kPrefValueLast = 1; |
41 static const int kPrefValueURLs = 4; | 41 static const int kPrefValueURLs = 4; |
42 static const int kPrefValueNewTab = 5; | 42 static const int kPrefValueNewTab = 5; |
43 | 43 |
44 static void RegisterUserPrefs(PrefServiceSyncable* prefs); | 44 static void RegisterUserPrefs(PrefRegistrySyncable* registry); |
45 | 45 |
46 // Returns the default value for |type|. | 46 // Returns the default value for |type|. |
47 static Type GetDefaultStartupType(); | 47 static Type GetDefaultStartupType(); |
48 | 48 |
49 // What should happen on startup for the specified profile. | 49 // What should happen on startup for the specified profile. |
50 static void SetStartupPref(Profile* profile, const SessionStartupPref& pref); | 50 static void SetStartupPref(Profile* profile, const SessionStartupPref& pref); |
51 static void SetStartupPref(PrefService* prefs, | 51 static void SetStartupPref(PrefService* prefs, |
52 const SessionStartupPref& pref); | 52 const SessionStartupPref& pref); |
53 static SessionStartupPref GetStartupPref(Profile* profile); | 53 static SessionStartupPref GetStartupPref(Profile* profile); |
54 static SessionStartupPref GetStartupPref(PrefService* prefs); | 54 static SessionStartupPref GetStartupPref(PrefService* prefs); |
(...skipping 22 matching lines...) Expand all Loading... |
77 ~SessionStartupPref(); | 77 ~SessionStartupPref(); |
78 | 78 |
79 // What to do on startup. | 79 // What to do on startup. |
80 Type type; | 80 Type type; |
81 | 81 |
82 // The URLs to restore. Only used if type == URLS. | 82 // The URLs to restore. Only used if type == URLS. |
83 std::vector<GURL> urls; | 83 std::vector<GURL> urls; |
84 }; | 84 }; |
85 | 85 |
86 #endif // CHROME_BROWSER_PREFS_SESSION_STARTUP_PREF_H__ | 86 #endif // CHROME_BROWSER_PREFS_SESSION_STARTUP_PREF_H__ |
OLD | NEW |