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

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

Issue 10656033: [sync] Automatic bootstrapping of Sync on Win 8 from cached credentials (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix TokenServiceTests Created 8 years, 5 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/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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 234
235 syncer::ModelTypeSet SyncPrefs::GetAcknowledgeSyncedTypesForTest() const { 235 syncer::ModelTypeSet SyncPrefs::GetAcknowledgeSyncedTypesForTest() const {
236 DCHECK(CalledOnValidThread()); 236 DCHECK(CalledOnValidThread());
237 if (!pref_service_) { 237 if (!pref_service_) {
238 return syncer::ModelTypeSet(); 238 return syncer::ModelTypeSet();
239 } 239 }
240 return syncer::ModelTypeSetFromValue( 240 return syncer::ModelTypeSetFromValue(
241 *pref_service_->GetList(prefs::kSyncAcknowledgedSyncTypes)); 241 *pref_service_->GetList(prefs::kSyncAcknowledgedSyncTypes));
242 } 242 }
243 243
244 namespace { 244 // static
245 245 const char* SyncPrefs::GetPrefNameForDataType(syncer::ModelType data_type) {
246 const char* GetPrefNameForDataType(syncer::ModelType data_type) {
247 switch (data_type) { 246 switch (data_type) {
248 case syncer::BOOKMARKS: 247 case syncer::BOOKMARKS:
249 return prefs::kSyncBookmarks; 248 return prefs::kSyncBookmarks;
250 case syncer::PASSWORDS: 249 case syncer::PASSWORDS:
251 return prefs::kSyncPasswords; 250 return prefs::kSyncPasswords;
252 case syncer::PREFERENCES: 251 case syncer::PREFERENCES:
253 return prefs::kSyncPreferences; 252 return prefs::kSyncPreferences;
254 case syncer::AUTOFILL: 253 case syncer::AUTOFILL:
255 return prefs::kSyncAutofill; 254 return prefs::kSyncAutofill;
256 case syncer::AUTOFILL_PROFILE: 255 case syncer::AUTOFILL_PROFILE:
(...skipping 14 matching lines...) Expand all
271 return prefs::kSyncSearchEngines; 270 return prefs::kSyncSearchEngines;
272 case syncer::SESSIONS: 271 case syncer::SESSIONS:
273 return prefs::kSyncSessions; 272 return prefs::kSyncSessions;
274 case syncer::APP_NOTIFICATIONS: 273 case syncer::APP_NOTIFICATIONS:
275 return prefs::kSyncAppNotifications; 274 return prefs::kSyncAppNotifications;
276 default: 275 default:
277 break; 276 break;
278 } 277 }
279 NOTREACHED(); 278 NOTREACHED();
280 return NULL; 279 return NULL;
281 } 280 }
Roger Tawa OOO till Jul 10th 2012/07/23 15:10:33 I think this method should be moved to match order
Raghu Simha 2012/07/23 20:35:54 Done.
282 281
283 } // namespace
284
285 void SyncPrefs::RegisterPrefGroups() { 282 void SyncPrefs::RegisterPrefGroups() {
286 pref_groups_[syncer::APPS].Put(syncer::APP_NOTIFICATIONS); 283 pref_groups_[syncer::APPS].Put(syncer::APP_NOTIFICATIONS);
287 pref_groups_[syncer::APPS].Put(syncer::APP_SETTINGS); 284 pref_groups_[syncer::APPS].Put(syncer::APP_SETTINGS);
288 285
289 pref_groups_[syncer::AUTOFILL].Put(syncer::AUTOFILL_PROFILE); 286 pref_groups_[syncer::AUTOFILL].Put(syncer::AUTOFILL_PROFILE);
290 287
291 pref_groups_[syncer::EXTENSIONS].Put(syncer::EXTENSION_SETTINGS); 288 pref_groups_[syncer::EXTENSIONS].Put(syncer::EXTENSION_SETTINGS);
292 289
293 pref_groups_[syncer::PREFERENCES].Put(syncer::SEARCH_ENGINES); 290 pref_groups_[syncer::PREFERENCES].Put(syncer::SEARCH_ENGINES);
294 } 291 }
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 if (types.Has(i->first)) 415 if (types.Has(i->first))
419 types_with_groups.PutAll(i->second); 416 types_with_groups.PutAll(i->second);
420 else 417 else
421 types_with_groups.RemoveAll(i->second); 418 types_with_groups.RemoveAll(i->second);
422 } 419 }
423 types_with_groups.RetainAll(registered_types); 420 types_with_groups.RetainAll(registered_types);
424 return types_with_groups; 421 return types_with_groups;
425 } 422 }
426 423
427 } // namespace browser_sync 424 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698