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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 pref->urls.push_back(fixed_url); | 37 pref->urls.push_back(fixed_url); |
38 } | 38 } |
39 } | 39 } |
40 } | 40 } |
41 | 41 |
42 } // namespace | 42 } // namespace |
43 | 43 |
44 // static | 44 // static |
45 void SessionStartupPref::RegisterProfilePrefs( | 45 void SessionStartupPref::RegisterProfilePrefs( |
46 user_prefs::PrefRegistrySyncable* registry) { | 46 user_prefs::PrefRegistrySyncable* registry) { |
47 registry->RegisterIntegerPref( | 47 #if defined(OS_IOS) || defined(OS_ANDROID) |
48 prefs::kRestoreOnStartup, | 48 uint32_t flags = PrefRegistry::NO_REGISTRATION_FLAGS; |
49 TypeToPrefValue(GetDefaultStartupType()), | 49 #else |
50 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 50 uint32_t flags = user_prefs::PrefRegistrySyncable::SYNCABLE_PREF; |
51 registry->RegisterListPref(prefs::kURLsToRestoreOnStartup, | 51 #endif |
52 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 52 registry->RegisterIntegerPref(prefs::kRestoreOnStartup, |
| 53 TypeToPrefValue(GetDefaultStartupType()), |
| 54 flags); |
| 55 registry->RegisterListPref(prefs::kURLsToRestoreOnStartup, flags); |
53 } | 56 } |
54 | 57 |
55 // static | 58 // static |
56 SessionStartupPref::Type SessionStartupPref::GetDefaultStartupType() { | 59 SessionStartupPref::Type SessionStartupPref::GetDefaultStartupType() { |
57 #if defined(OS_CHROMEOS) | 60 #if defined(OS_CHROMEOS) |
58 return SessionStartupPref::LAST; | 61 return SessionStartupPref::LAST; |
59 #else | 62 #else |
60 return SessionStartupPref::DEFAULT; | 63 return SessionStartupPref::DEFAULT; |
61 #endif | 64 #endif |
62 } | 65 } |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 default: return SessionStartupPref::DEFAULT; | 152 default: return SessionStartupPref::DEFAULT; |
150 } | 153 } |
151 } | 154 } |
152 | 155 |
153 SessionStartupPref::SessionStartupPref(Type type) : type(type) {} | 156 SessionStartupPref::SessionStartupPref(Type type) : type(type) {} |
154 | 157 |
155 SessionStartupPref::SessionStartupPref(const SessionStartupPref& other) = | 158 SessionStartupPref::SessionStartupPref(const SessionStartupPref& other) = |
156 default; | 159 default; |
157 | 160 |
158 SessionStartupPref::~SessionStartupPref() {} | 161 SessionStartupPref::~SessionStartupPref() {} |
OLD | NEW |