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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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); |
55 | 55 |
56 // If the user had the "restore on startup" property set to the deprecated | |
57 // "Open the home page" value, this migrates them to a value that will have | |
58 // the same effect. | |
59 static void MigrateIfNecessary(PrefService* prefs); | |
60 | |
61 // Whether the startup type and URLs are managed via policy. | 56 // Whether the startup type and URLs are managed via policy. |
62 static bool TypeIsManaged(PrefService* prefs); | 57 static bool TypeIsManaged(PrefService* prefs); |
63 static bool URLsAreManaged(PrefService* prefs); | 58 static bool URLsAreManaged(PrefService* prefs); |
64 | 59 |
65 // Converts an integer pref value to a SessionStartupPref::Type. | 60 // Converts an integer pref value to a SessionStartupPref::Type. |
66 static SessionStartupPref::Type PrefValueToType(int pref_value); | 61 static SessionStartupPref::Type PrefValueToType(int pref_value); |
67 | 62 |
68 // Returns |true| if a change to startup type or URLS was detected by | 63 // Returns |true| if a change to startup type or URLS was detected by |
69 // ProtectorService. | 64 // ProtectorService. |
70 static bool DidStartupPrefChange(Profile* profile); | 65 static bool DidStartupPrefChange(Profile* profile); |
71 | 66 |
72 // Returns the protected backup of startup type and URLS. | 67 // Returns the protected backup of startup type and URLS. |
73 static SessionStartupPref GetStartupPrefBackup(Profile* profile); | 68 static SessionStartupPref GetStartupPrefBackup(Profile* profile); |
74 | 69 |
75 explicit SessionStartupPref(Type type); | 70 explicit SessionStartupPref(Type type); |
76 | 71 |
77 ~SessionStartupPref(); | 72 ~SessionStartupPref(); |
78 | 73 |
79 // What to do on startup. | 74 // What to do on startup. |
80 Type type; | 75 Type type; |
81 | 76 |
82 // The URLs to restore. Only used if type == URLS. | 77 // The URLs to restore. Only used if type == URLS. |
83 std::vector<GURL> urls; | 78 std::vector<GURL> urls; |
84 }; | 79 }; |
85 | 80 |
86 #endif // CHROME_BROWSER_PREFS_SESSION_STARTUP_PREF_H__ | 81 #endif // CHROME_BROWSER_PREFS_SESSION_STARTUP_PREF_H__ |
OLD | NEW |