| 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/sync/sync_prefs.h" | 5 #include "chrome/browser/sync/sync_prefs.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 bool enable_by_default = true; | 329 bool enable_by_default = true; |
| 330 #else | 330 #else |
| 331 bool enable_by_default = | 331 bool enable_by_default = |
| 332 !pref_service_->HasPrefPath(prefs::kSyncHasSetupCompleted); | 332 !pref_service_->HasPrefPath(prefs::kSyncHasSetupCompleted); |
| 333 #endif | 333 #endif |
| 334 | 334 |
| 335 pref_service_->RegisterBooleanPref(prefs::kSyncKeepEverythingSynced, | 335 pref_service_->RegisterBooleanPref(prefs::kSyncKeepEverythingSynced, |
| 336 enable_by_default, | 336 enable_by_default, |
| 337 PrefService::UNSYNCABLE_PREF); | 337 PrefService::UNSYNCABLE_PREF); |
| 338 | 338 |
| 339 syncer::ModelTypeSet user_types = syncer::UserTypes(); |
| 340 |
| 339 // Treat bookmarks specially. | 341 // Treat bookmarks specially. |
| 340 RegisterDataTypePreferredPref(syncer::BOOKMARKS, true); | 342 RegisterDataTypePreferredPref(syncer::BOOKMARKS, true); |
| 341 for (int i = syncer::PREFERENCES; i < syncer::MODEL_TYPE_COUNT; ++i) { | 343 user_types.Remove(syncer::BOOKMARKS); |
| 342 const syncer::ModelType type = syncer::ModelTypeFromInt(i); | 344 |
| 343 // Also treat nigori specially. | 345 for (syncer::ModelTypeSet::Iterator it = user_types.First(); |
| 344 if (type == syncer::NIGORI) { | 346 it.Good(); it.Inc()) { |
| 345 continue; | 347 RegisterDataTypePreferredPref(it.Get(), enable_by_default); |
| 346 } | |
| 347 RegisterDataTypePreferredPref(type, enable_by_default); | |
| 348 } | 348 } |
| 349 | 349 |
| 350 pref_service_->RegisterBooleanPref(prefs::kSyncManaged, | 350 pref_service_->RegisterBooleanPref(prefs::kSyncManaged, |
| 351 false, | 351 false, |
| 352 PrefService::UNSYNCABLE_PREF); | 352 PrefService::UNSYNCABLE_PREF); |
| 353 pref_service_->RegisterStringPref(prefs::kSyncEncryptionBootstrapToken, | 353 pref_service_->RegisterStringPref(prefs::kSyncEncryptionBootstrapToken, |
| 354 "", | 354 "", |
| 355 PrefService::UNSYNCABLE_PREF); | 355 PrefService::UNSYNCABLE_PREF); |
| 356 pref_service_->RegisterStringPref( | 356 pref_service_->RegisterStringPref( |
| 357 prefs::kSyncKeystoreEncryptionBootstrapToken, | 357 prefs::kSyncKeystoreEncryptionBootstrapToken, |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 if (types.Has(i->first)) | 433 if (types.Has(i->first)) |
| 434 types_with_groups.PutAll(i->second); | 434 types_with_groups.PutAll(i->second); |
| 435 else | 435 else |
| 436 types_with_groups.RemoveAll(i->second); | 436 types_with_groups.RemoveAll(i->second); |
| 437 } | 437 } |
| 438 types_with_groups.RetainAll(registered_types); | 438 types_with_groups.RetainAll(registered_types); |
| 439 return types_with_groups; | 439 return types_with_groups; |
| 440 } | 440 } |
| 441 | 441 |
| 442 } // namespace browser_sync | 442 } // namespace browser_sync |
| OLD | NEW |