Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(889)

Unified Diff: chrome/browser/prefs/session_startup_pref.cc

Issue 9748016: [protector] Added UI for invalid Preferences backup case. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix unit-test. Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/prefs/session_startup_pref.h ('k') | chrome/browser/protector/base_setting_change.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prefs/session_startup_pref.cc
diff --git a/chrome/browser/prefs/session_startup_pref.cc b/chrome/browser/prefs/session_startup_pref.cc
index 2cd04d2d3c3ade196440462bf78ae893582989d5..b8f3d5c12d37de482eb5f53c35aed0a459b1e475 100644
--- a/chrome/browser/prefs/session_startup_pref.cc
+++ b/chrome/browser/prefs/session_startup_pref.cc
@@ -62,6 +62,15 @@ void URLListToPref(const base::ListValue* url_list, SessionStartupPref* pref) {
// static
void SessionStartupPref::RegisterUserPrefs(PrefService* prefs) {
+ prefs->RegisterIntegerPref(prefs::kRestoreOnStartup,
+ TypeToPrefValue(GetDefaultStartupType()),
+ PrefService::SYNCABLE_PREF);
+ prefs->RegisterListPref(prefs::kURLsToRestoreOnStartup,
+ PrefService::SYNCABLE_PREF);
+}
+
+// static
+SessionStartupPref::Type SessionStartupPref::GetDefaultStartupType() {
#if defined(OS_CHROMEOS)
SessionStartupPref::Type type = SessionStartupPref::LAST;
#else
@@ -74,11 +83,7 @@ void SessionStartupPref::RegisterUserPrefs(PrefService* prefs) {
type = SessionStartupPref::LAST;
#endif
- prefs->RegisterIntegerPref(prefs::kRestoreOnStartup,
- TypeToPrefValue(type),
- PrefService::SYNCABLE_PREF);
- prefs->RegisterListPref(prefs::kURLsToRestoreOnStartup,
- PrefService::SYNCABLE_PREF);
+ return type;
}
// static
« no previous file with comments | « chrome/browser/prefs/session_startup_pref.h ('k') | chrome/browser/protector/base_setting_change.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698