| 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 "components/sync_driver/sync_prefs.h" | 5 #include "components/sync_driver/sync_prefs.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/prefs/pref_member.h" | 8 #include "base/prefs/pref_member.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 // Include proxy types as well, as they can be individually selected, | 65 // Include proxy types as well, as they can be individually selected, |
| 66 // although they don't have sync representations. | 66 // although they don't have sync representations. |
| 67 user_types.PutAll(syncer::ProxyTypes()); | 67 user_types.PutAll(syncer::ProxyTypes()); |
| 68 | 68 |
| 69 // Treat bookmarks and device info specially. | 69 // Treat bookmarks and device info specially. |
| 70 RegisterDataTypePreferredPref(registry, syncer::BOOKMARKS, true); | 70 RegisterDataTypePreferredPref(registry, syncer::BOOKMARKS, true); |
| 71 RegisterDataTypePreferredPref(registry, syncer::DEVICE_INFO, true); | 71 RegisterDataTypePreferredPref(registry, syncer::DEVICE_INFO, true); |
| 72 user_types.Remove(syncer::BOOKMARKS); | 72 user_types.Remove(syncer::BOOKMARKS); |
| 73 user_types.Remove(syncer::DEVICE_INFO); | 73 user_types.Remove(syncer::DEVICE_INFO); |
| 74 | 74 |
| 75 // These two prefs are set from sync experiment to enable enhanced bookmarks. | |
| 76 registry->RegisterIntegerPref( | |
| 77 prefs::kEnhancedBookmarksExperimentEnabled, | |
| 78 0, | |
| 79 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 80 | |
| 81 registry->RegisterStringPref( | |
| 82 prefs::kEnhancedBookmarksExtensionId, | |
| 83 std::string(), | |
| 84 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 85 | |
| 86 // All types are set to off by default, which forces a configuration to | 75 // All types are set to off by default, which forces a configuration to |
| 87 // explicitly enable them. GetPreferredTypes() will ensure that any new | 76 // explicitly enable them. GetPreferredTypes() will ensure that any new |
| 88 // implicit types are enabled when their pref group is, or via | 77 // implicit types are enabled when their pref group is, or via |
| 89 // KeepEverythingSynced. | 78 // KeepEverythingSynced. |
| 90 for (syncer::ModelTypeSet::Iterator it = user_types.First(); it.Good(); | 79 for (syncer::ModelTypeSet::Iterator it = user_types.First(); it.Good(); |
| 91 it.Inc()) { | 80 it.Inc()) { |
| 92 RegisterDataTypePreferredPref(registry, it.Get(), false); | 81 RegisterDataTypePreferredPref(registry, it.Get(), false); |
| 93 } | 82 } |
| 94 | 83 |
| 95 registry->RegisterBooleanPref( | 84 registry->RegisterBooleanPref( |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 | 461 |
| 473 void SyncPrefs::SetFirstSyncTime(base::Time time) { | 462 void SyncPrefs::SetFirstSyncTime(base::Time time) { |
| 474 pref_service_->SetInt64(prefs::kSyncFirstSyncTime, time.ToInternalValue()); | 463 pref_service_->SetInt64(prefs::kSyncFirstSyncTime, time.ToInternalValue()); |
| 475 } | 464 } |
| 476 | 465 |
| 477 void SyncPrefs::ClearFirstSyncTime() { | 466 void SyncPrefs::ClearFirstSyncTime() { |
| 478 pref_service_->ClearPref(prefs::kSyncFirstSyncTime); | 467 pref_service_->ClearPref(prefs::kSyncFirstSyncTime); |
| 479 } | 468 } |
| 480 | 469 |
| 481 } // namespace sync_driver | 470 } // namespace sync_driver |
| OLD | NEW |