| 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 "url/gurl.h" | 10 #include "url/gurl.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 // Indicates the user wants to restore a specific set of URLs. The URLs | 30 // Indicates the user wants to restore a specific set of URLs. The URLs |
| 31 // are contained in urls. | 31 // are contained in urls. |
| 32 URLS = 3, | 32 URLS = 3, |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 // For historical reasons the enum and value registered in the prefs don't | 35 // For historical reasons the enum and value registered in the prefs don't |
| 36 // line up. These are the values registered in prefs. | 36 // line up. These are the values registered in prefs. |
| 37 // The values are also recorded in Settings.StartupPageLoadSettings histogram, | 37 // The values are also recorded in Settings.StartupPageLoadSettings histogram, |
| 38 // so make sure to update histograms.xml if you change these. | 38 // so make sure to update histograms.xml if you change these. |
| 39 static const int kPrefValueLast = 1; | 39 enum PrefValue { |
| 40 static const int kPrefValueURLs = 4; | 40 kPrefValueLast = 1, |
| 41 static const int kPrefValueNewTab = 5; | 41 kPrefValueURLs = 4, |
| 42 static const int kPrefValueMax = 6; | 42 kPrefValueNewTab = 5, |
| 43 kPrefValueMax = 6, |
| 44 }; |
| 43 | 45 |
| 44 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 46 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| 45 | 47 |
| 46 // Returns the default value for |type|. | 48 // Returns the default value for |type|. |
| 47 static Type GetDefaultStartupType(); | 49 static Type GetDefaultStartupType(); |
| 48 | 50 |
| 49 // What should happen on startup for the specified profile. | 51 // What should happen on startup for the specified profile. |
| 50 static void SetStartupPref(Profile* profile, const SessionStartupPref& pref); | 52 static void SetStartupPref(Profile* profile, const SessionStartupPref& pref); |
| 51 static void SetStartupPref(PrefService* prefs, | 53 static void SetStartupPref(PrefService* prefs, |
| 52 const SessionStartupPref& pref); | 54 const SessionStartupPref& pref); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 70 ~SessionStartupPref(); | 72 ~SessionStartupPref(); |
| 71 | 73 |
| 72 // What to do on startup. | 74 // What to do on startup. |
| 73 Type type; | 75 Type type; |
| 74 | 76 |
| 75 // The URLs to restore. Only used if type == URLS. | 77 // The URLs to restore. Only used if type == URLS. |
| 76 std::vector<GURL> urls; | 78 std::vector<GURL> urls; |
| 77 }; | 79 }; |
| 78 | 80 |
| 79 #endif // CHROME_BROWSER_PREFS_SESSION_STARTUP_PREF_H__ | 81 #endif // CHROME_BROWSER_PREFS_SESSION_STARTUP_PREF_H__ |
| OLD | NEW |