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

Side by Side Diff: chrome/browser/prefs/session_startup_pref.cc

Issue 11570009: Split PrefService into PrefService, PrefServiceSimple and PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "chrome/browser/prefs/session_startup_pref.h" 5 #include "chrome/browser/prefs/session_startup_pref.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "base/version.h" 10 #include "base/version.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 if (url_list->GetString(i, &url_text)) { 46 if (url_list->GetString(i, &url_text)) {
47 GURL fixed_url = URLFixerUpper::FixupURL(url_text, ""); 47 GURL fixed_url = URLFixerUpper::FixupURL(url_text, "");
48 pref->urls.push_back(fixed_url); 48 pref->urls.push_back(fixed_url);
49 } 49 }
50 } 50 }
51 } 51 }
52 52
53 } // namespace 53 } // namespace
54 54
55 // static 55 // static
56 void SessionStartupPref::RegisterUserPrefs(PrefService* prefs) { 56 void SessionStartupPref::RegisterUserPrefs(PrefServiceSyncable* prefs) {
57 prefs->RegisterIntegerPref(prefs::kRestoreOnStartup, 57 prefs->RegisterIntegerPref(prefs::kRestoreOnStartup,
58 TypeToPrefValue(GetDefaultStartupType()), 58 TypeToPrefValue(GetDefaultStartupType()),
59 PrefService::SYNCABLE_PREF); 59 PrefServiceSyncable::SYNCABLE_PREF);
60 prefs->RegisterListPref(prefs::kURLsToRestoreOnStartup, 60 prefs->RegisterListPref(prefs::kURLsToRestoreOnStartup,
61 PrefService::SYNCABLE_PREF); 61 PrefServiceSyncable::SYNCABLE_PREF);
62 prefs->RegisterBooleanPref(prefs::kRestoreOnStartupMigrated, 62 prefs->RegisterBooleanPref(prefs::kRestoreOnStartupMigrated,
63 false, 63 false,
64 PrefService::UNSYNCABLE_PREF); 64 PrefServiceSyncable::UNSYNCABLE_PREF);
65 } 65 }
66 66
67 // static 67 // static
68 SessionStartupPref::Type SessionStartupPref::GetDefaultStartupType() { 68 SessionStartupPref::Type SessionStartupPref::GetDefaultStartupType() {
69 #if defined(OS_CHROMEOS) 69 #if defined(OS_CHROMEOS)
70 return SessionStartupPref::LAST; 70 return SessionStartupPref::LAST;
71 #else 71 #else
72 return SessionStartupPref::DEFAULT; 72 return SessionStartupPref::DEFAULT;
73 #endif 73 #endif
74 } 74 }
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 case kPrefValueLast: return SessionStartupPref::LAST; 225 case kPrefValueLast: return SessionStartupPref::LAST;
226 case kPrefValueURLs: return SessionStartupPref::URLS; 226 case kPrefValueURLs: return SessionStartupPref::URLS;
227 case kPrefValueHomePage: return SessionStartupPref::HOMEPAGE; 227 case kPrefValueHomePage: return SessionStartupPref::HOMEPAGE;
228 default: return SessionStartupPref::DEFAULT; 228 default: return SessionStartupPref::DEFAULT;
229 } 229 }
230 } 230 }
231 231
232 SessionStartupPref::SessionStartupPref(Type type) : type(type) {} 232 SessionStartupPref::SessionStartupPref(Type type) : type(type) {}
233 233
234 SessionStartupPref::~SessionStartupPref() {} 234 SessionStartupPref::~SessionStartupPref() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698