| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 // Whether the startup type and URLs are managed via policy. | 61 // Whether the startup type and URLs are managed via policy. |
| 62 static bool TypeIsManaged(PrefService* prefs); | 62 static bool TypeIsManaged(PrefService* prefs); |
| 63 static bool URLsAreManaged(PrefService* prefs); | 63 static bool URLsAreManaged(PrefService* prefs); |
| 64 | 64 |
| 65 // Whether the startup type has not been overridden from its default. |
| 66 static bool TypeIsDefault(PrefService* prefs); |
| 67 |
| 65 // Converts an integer pref value to a SessionStartupPref::Type. | 68 // Converts an integer pref value to a SessionStartupPref::Type. |
| 66 static SessionStartupPref::Type PrefValueToType(int pref_value); | 69 static SessionStartupPref::Type PrefValueToType(int pref_value); |
| 67 | 70 |
| 68 // Returns |true| if a change to startup type or URLS was detected by | 71 // Returns |true| if a change to startup type or URLS was detected by |
| 69 // ProtectorService. | 72 // ProtectorService. |
| 70 static bool DidStartupPrefChange(Profile* profile); | 73 static bool DidStartupPrefChange(Profile* profile); |
| 71 | 74 |
| 72 // Returns the protected backup of startup type and URLS. | 75 // Returns the protected backup of startup type and URLS. |
| 73 static SessionStartupPref GetStartupPrefBackup(Profile* profile); | 76 static SessionStartupPref GetStartupPrefBackup(Profile* profile); |
| 74 | 77 |
| 75 explicit SessionStartupPref(Type type); | 78 explicit SessionStartupPref(Type type); |
| 76 | 79 |
| 77 ~SessionStartupPref(); | 80 ~SessionStartupPref(); |
| 78 | 81 |
| 79 // What to do on startup. | 82 // What to do on startup. |
| 80 Type type; | 83 Type type; |
| 81 | 84 |
| 82 // The URLs to restore. Only used if type == URLS. | 85 // The URLs to restore. Only used if type == URLS. |
| 83 std::vector<GURL> urls; | 86 std::vector<GURL> urls; |
| 84 }; | 87 }; |
| 85 | 88 |
| 86 #endif // CHROME_BROWSER_PREFS_SESSION_STARTUP_PREF_H__ | 89 #endif // CHROME_BROWSER_PREFS_SESSION_STARTUP_PREF_H__ |
| OLD | NEW |