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 #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/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 if (url_list->GetString(i, &url_text)) { | 47 if (url_list->GetString(i, &url_text)) { |
48 GURL fixed_url = URLFixerUpper::FixupURL(url_text, std::string()); | 48 GURL fixed_url = URLFixerUpper::FixupURL(url_text, std::string()); |
49 pref->urls.push_back(fixed_url); | 49 pref->urls.push_back(fixed_url); |
50 } | 50 } |
51 } | 51 } |
52 } | 52 } |
53 | 53 |
54 } // namespace | 54 } // namespace |
55 | 55 |
56 // static | 56 // static |
57 void SessionStartupPref::RegisterUserPrefs(PrefRegistrySyncable* registry) { | 57 void SessionStartupPref::RegisterUserPrefs( |
58 registry->RegisterIntegerPref(prefs::kRestoreOnStartup, | 58 user_prefs::PrefRegistrySyncable* registry) { |
59 TypeToPrefValue(GetDefaultStartupType()), | 59 registry->RegisterIntegerPref( |
60 PrefRegistrySyncable::SYNCABLE_PREF); | 60 prefs::kRestoreOnStartup, |
| 61 TypeToPrefValue(GetDefaultStartupType()), |
| 62 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
61 registry->RegisterListPref(prefs::kURLsToRestoreOnStartup, | 63 registry->RegisterListPref(prefs::kURLsToRestoreOnStartup, |
62 PrefRegistrySyncable::SYNCABLE_PREF); | 64 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
63 registry->RegisterBooleanPref(prefs::kRestoreOnStartupMigrated, | 65 registry->RegisterBooleanPref( |
64 false, | 66 prefs::kRestoreOnStartupMigrated, |
65 PrefRegistrySyncable::UNSYNCABLE_PREF); | 67 false, |
| 68 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
66 } | 69 } |
67 | 70 |
68 // static | 71 // static |
69 SessionStartupPref::Type SessionStartupPref::GetDefaultStartupType() { | 72 SessionStartupPref::Type SessionStartupPref::GetDefaultStartupType() { |
70 #if defined(OS_CHROMEOS) | 73 #if defined(OS_CHROMEOS) |
71 return SessionStartupPref::LAST; | 74 return SessionStartupPref::LAST; |
72 #else | 75 #else |
73 return SessionStartupPref::DEFAULT; | 76 return SessionStartupPref::DEFAULT; |
74 #endif | 77 #endif |
75 } | 78 } |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 case kPrefValueLast: return SessionStartupPref::LAST; | 232 case kPrefValueLast: return SessionStartupPref::LAST; |
230 case kPrefValueURLs: return SessionStartupPref::URLS; | 233 case kPrefValueURLs: return SessionStartupPref::URLS; |
231 case kPrefValueHomePage: return SessionStartupPref::HOMEPAGE; | 234 case kPrefValueHomePage: return SessionStartupPref::HOMEPAGE; |
232 default: return SessionStartupPref::DEFAULT; | 235 default: return SessionStartupPref::DEFAULT; |
233 } | 236 } |
234 } | 237 } |
235 | 238 |
236 SessionStartupPref::SessionStartupPref(Type type) : type(type) {} | 239 SessionStartupPref::SessionStartupPref(Type type) : type(type) {} |
237 | 240 |
238 SessionStartupPref::~SessionStartupPref() {} | 241 SessionStartupPref::~SessionStartupPref() {} |
OLD | NEW |