| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/string_piece.h" | 9 #include "base/string_piece.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 case kPrefValueURLs: return SessionStartupPref::URLS; | 39 case kPrefValueURLs: return SessionStartupPref::URLS; |
| 40 default: return SessionStartupPref::DEFAULT; | 40 default: return SessionStartupPref::DEFAULT; |
| 41 } | 41 } |
| 42 } | 42 } |
| 43 | 43 |
| 44 } // namespace | 44 } // namespace |
| 45 | 45 |
| 46 // static | 46 // static |
| 47 void SessionStartupPref::RegisterUserPrefs(PrefService* prefs) { | 47 void SessionStartupPref::RegisterUserPrefs(PrefService* prefs) { |
| 48 prefs->RegisterIntegerPref(prefs::kRestoreOnStartup, | 48 prefs->RegisterIntegerPref(prefs::kRestoreOnStartup, |
| 49 TypeToPrefValue(browser_defaults::kDefaultSessionStartupType)); | 49 TypeToPrefValue( |
| 50 prefs->RegisterListPref(prefs::kURLsToRestoreOnStartup); | 50 browser_defaults::kDefaultSessionStartupType), |
| 51 PrefService::SYNCABLE_PREF); |
| 52 prefs->RegisterListPref(prefs::kURLsToRestoreOnStartup, |
| 53 PrefService::SYNCABLE_PREF); |
| 51 } | 54 } |
| 52 | 55 |
| 53 // static | 56 // static |
| 54 void SessionStartupPref::SetStartupPref( | 57 void SessionStartupPref::SetStartupPref( |
| 55 Profile* profile, | 58 Profile* profile, |
| 56 const SessionStartupPref& pref) { | 59 const SessionStartupPref& pref) { |
| 57 DCHECK(profile); | 60 DCHECK(profile); |
| 58 SetStartupPref(profile->GetPrefs(), pref); | 61 SetStartupPref(profile->GetPrefs(), pref); |
| 59 } | 62 } |
| 60 | 63 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 prefs->FindPreference(prefs::kURLsToRestoreOnStartup); | 131 prefs->FindPreference(prefs::kURLsToRestoreOnStartup); |
| 129 DCHECK(pref_urls); | 132 DCHECK(pref_urls); |
| 130 return pref_urls->IsManaged(); | 133 return pref_urls->IsManaged(); |
| 131 } | 134 } |
| 132 | 135 |
| 133 SessionStartupPref::SessionStartupPref() : type(DEFAULT) {} | 136 SessionStartupPref::SessionStartupPref() : type(DEFAULT) {} |
| 134 | 137 |
| 135 SessionStartupPref::SessionStartupPref(Type type) : type(type) {} | 138 SessionStartupPref::SessionStartupPref(Type type) : type(type) {} |
| 136 | 139 |
| 137 SessionStartupPref::~SessionStartupPref() {} | 140 SessionStartupPref::~SessionStartupPref() {} |
| OLD | NEW |