| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 | 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 | 57 // "Open the home page" value, this migrates them to a value that will have |
| 58 // the same effect. | 58 // the same effect. |
| 59 static void MigrateIfNecessary(PrefService* prefs); | 59 static void MigrateIfNecessary(PrefService* prefs); |
| 60 | 60 |
| 61 // The default startup pref for Mac used to be LAST, now it's DEFAULT. This |
| 62 // migrates old users by writing out the preference explicitly. |
| 63 static void MigrateMacDefaultPrefIfNecessary(PrefService* prefs); |
| 64 |
| 61 // Whether the startup type and URLs are managed via policy. | 65 // Whether the startup type and URLs are managed via policy. |
| 62 static bool TypeIsManaged(PrefService* prefs); | 66 static bool TypeIsManaged(PrefService* prefs); |
| 63 static bool URLsAreManaged(PrefService* prefs); | 67 static bool URLsAreManaged(PrefService* prefs); |
| 64 | 68 |
| 65 // Whether the startup type has not been overridden from its default. | 69 // Whether the startup type has not been overridden from its default. |
| 66 static bool TypeIsDefault(PrefService* prefs); | 70 static bool TypeIsDefault(PrefService* prefs); |
| 67 | 71 |
| 68 // Converts an integer pref value to a SessionStartupPref::Type. | 72 // Converts an integer pref value to a SessionStartupPref::Type. |
| 69 static SessionStartupPref::Type PrefValueToType(int pref_value); | 73 static SessionStartupPref::Type PrefValueToType(int pref_value); |
| 70 | 74 |
| 71 // Returns |true| if a change to startup type or URLS was detected by | 75 // Returns |true| if a change to startup type or URLS was detected by |
| 72 // ProtectorService. | 76 // ProtectorService. |
| 73 static bool DidStartupPrefChange(Profile* profile); | 77 static bool DidStartupPrefChange(Profile* profile); |
| 74 | 78 |
| 75 // Returns the protected backup of startup type and URLS. | 79 // Returns the protected backup of startup type and URLS. |
| 76 static SessionStartupPref GetStartupPrefBackup(Profile* profile); | 80 static SessionStartupPref GetStartupPrefBackup(Profile* profile); |
| 77 | 81 |
| 78 explicit SessionStartupPref(Type type); | 82 explicit SessionStartupPref(Type type); |
| 79 | 83 |
| 80 ~SessionStartupPref(); | 84 ~SessionStartupPref(); |
| 81 | 85 |
| 82 // What to do on startup. | 86 // What to do on startup. |
| 83 Type type; | 87 Type type; |
| 84 | 88 |
| 85 // The URLs to restore. Only used if type == URLS. | 89 // The URLs to restore. Only used if type == URLS. |
| 86 std::vector<GURL> urls; | 90 std::vector<GURL> urls; |
| 87 }; | 91 }; |
| 88 | 92 |
| 89 #endif // CHROME_BROWSER_PREFS_SESSION_STARTUP_PREF_H__ | 93 #endif // CHROME_BROWSER_PREFS_SESSION_STARTUP_PREF_H__ |
| OLD | NEW |