summaryrefslogtreecommitdiffstats
path: root/chrome/browser/prefs/session_startup_pref.cc
diff options
context:
space:
mode:
authortbreisacher@chromium.org <tbreisacher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-29 19:48:47 +0000
committertbreisacher@chromium.org <tbreisacher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-29 19:48:47 +0000
commit7c2341a9eefd706c6a404f9758508f0d4414dffc (patch)
treeee26b2b4f059420f28d1095a2857ab09c58b1eea /chrome/browser/prefs/session_startup_pref.cc
parentea6a4061e5a0c9f6b402705204934d7d67191018 (diff)
downloadchromium_src-7c2341a9eefd706c6a404f9758508f0d4414dffc.zip
chromium_src-7c2341a9eefd706c6a404f9758508f0d4414dffc.tar.gz
chromium_src-7c2341a9eefd706c6a404f9758508f0d4414dffc.tar.bz2
Add new option for loading NTP at startup, rework homepage UI
This will be followed up with another CL which deprecates the "Load the homepage" option in the startup section, and migrates users that have that option selected to "Load the following URLs" BUG=111139 TEST=visual Review URL: https://chromiumcodereview.appspot.com/9455072 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124233 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/prefs/session_startup_pref.cc')
-rw-r--r--chrome/browser/prefs/session_startup_pref.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/chrome/browser/prefs/session_startup_pref.cc b/chrome/browser/prefs/session_startup_pref.cc
index 68835ef..1084194 100644
--- a/chrome/browser/prefs/session_startup_pref.cc
+++ b/chrome/browser/prefs/session_startup_pref.cc
@@ -20,16 +20,18 @@ namespace {
// For historical reasons the enum and value registered in the prefs don't line
// up. These are the values registered in prefs.
-const int kPrefValueDefault = 0;
+const int kPrefValueHomePage = 0;
const int kPrefValueLast = 1;
const int kPrefValueURLs = 4;
+const int kPrefValueNewTab = 5;
// Converts a SessionStartupPref::Type to an integer written to prefs.
int TypeToPrefValue(SessionStartupPref::Type type) {
switch (type) {
- case SessionStartupPref::LAST: return kPrefValueLast;
- case SessionStartupPref::URLS: return kPrefValueURLs;
- default: return kPrefValueDefault;
+ case SessionStartupPref::HOMEPAGE: return kPrefValueHomePage;
+ case SessionStartupPref::LAST: return kPrefValueLast;
+ case SessionStartupPref::URLS: return kPrefValueURLs;
+ default: return kPrefValueNewTab;
}
}
@@ -139,14 +141,13 @@ bool SessionStartupPref::URLsAreManaged(PrefService* prefs) {
// static
SessionStartupPref::Type SessionStartupPref::PrefValueToType(int pref_value) {
switch (pref_value) {
- case kPrefValueLast: return SessionStartupPref::LAST;
- case kPrefValueURLs: return SessionStartupPref::URLS;
- default: return SessionStartupPref::DEFAULT;
+ case kPrefValueLast: return SessionStartupPref::LAST;
+ case kPrefValueURLs: return SessionStartupPref::URLS;
+ case kPrefValueHomePage: return SessionStartupPref::HOMEPAGE;
+ default: return SessionStartupPref::DEFAULT;
}
}
-SessionStartupPref::SessionStartupPref() : type(DEFAULT) {}
-
SessionStartupPref::SessionStartupPref(Type type) : type(type) {}
SessionStartupPref::~SessionStartupPref() {}