Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: chrome/browser/sync/sync_prefs.cc

Issue 11958029: [Sync] Add support for proxy types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Switch to ProxyTypes Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/sync_backend_host.cc ('k') | chrome/browser/sync/test/integration/migration_errors_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698