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/prefs/public/pref_member.h" | 8 #include "base/prefs/public/pref_member.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 #else | 62 #else |
63 bool enable_by_default = !prefs->HasPrefPath(prefs::kSyncHasSetupCompleted); | 63 bool enable_by_default = !prefs->HasPrefPath(prefs::kSyncHasSetupCompleted); |
64 #endif | 64 #endif |
65 | 65 |
66 prefs->RegisterBooleanPref(prefs::kSyncKeepEverythingSynced, | 66 prefs->RegisterBooleanPref(prefs::kSyncKeepEverythingSynced, |
67 enable_by_default, | 67 enable_by_default, |
68 PrefServiceSyncable::UNSYNCABLE_PREF); | 68 PrefServiceSyncable::UNSYNCABLE_PREF); |
69 | 69 |
70 syncer::ModelTypeSet user_types = syncer::UserTypes(); | 70 syncer::ModelTypeSet user_types = syncer::UserTypes(); |
71 | 71 |
| 72 // Include proxy types as well, as they can be individually selected, |
| 73 // although they don't have sync representations. |
| 74 user_types.PutAll(syncer::ProxyTypes()); |
| 75 |
72 // Treat bookmarks specially. | 76 // Treat bookmarks specially. |
73 RegisterDataTypePreferredPref(prefs, syncer::BOOKMARKS, true); | 77 RegisterDataTypePreferredPref(prefs, syncer::BOOKMARKS, true); |
74 user_types.Remove(syncer::BOOKMARKS); | 78 user_types.Remove(syncer::BOOKMARKS); |
75 | 79 |
76 for (syncer::ModelTypeSet::Iterator it = user_types.First(); | 80 for (syncer::ModelTypeSet::Iterator it = user_types.First(); |
77 it.Good(); it.Inc()) { | 81 it.Good(); it.Inc()) { |
78 RegisterDataTypePreferredPref(prefs, it.Get(), enable_by_default); | 82 RegisterDataTypePreferredPref(prefs, it.Get(), enable_by_default); |
79 } | 83 } |
80 | 84 |
81 prefs->RegisterBooleanPref(prefs::kSyncManaged, | 85 prefs->RegisterBooleanPref(prefs::kSyncManaged, |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 if (types.Has(i->first)) | 441 if (types.Has(i->first)) |
438 types_with_groups.PutAll(i->second); | 442 types_with_groups.PutAll(i->second); |
439 else | 443 else |
440 types_with_groups.RemoveAll(i->second); | 444 types_with_groups.RemoveAll(i->second); |
441 } | 445 } |
442 types_with_groups.RetainAll(registered_types); | 446 types_with_groups.RetainAll(registered_types); |
443 return types_with_groups; | 447 return types_with_groups; |
444 } | 448 } |
445 | 449 |
446 } // namespace browser_sync | 450 } // namespace browser_sync |
OLD | NEW |