| 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/prefs/public/pref_member.h" | 10 #include "base/prefs/public/pref_member.h" |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 case syncer::SYNCED_NOTIFICATIONS: | 333 case syncer::SYNCED_NOTIFICATIONS: |
| 334 return prefs::kSyncSyncedNotifications; | 334 return prefs::kSyncSyncedNotifications; |
| 335 case syncer::DICTIONARY: | 335 case syncer::DICTIONARY: |
| 336 return prefs::kSyncDictionary; | 336 return prefs::kSyncDictionary; |
| 337 case syncer::FAVICON_IMAGES: | 337 case syncer::FAVICON_IMAGES: |
| 338 return prefs::kSyncFaviconImages; | 338 return prefs::kSyncFaviconImages; |
| 339 case syncer::FAVICON_TRACKING: | 339 case syncer::FAVICON_TRACKING: |
| 340 return prefs::kSyncFaviconTracking; | 340 return prefs::kSyncFaviconTracking; |
| 341 case syncer::PROXY_TABS: | 341 case syncer::PROXY_TABS: |
| 342 return prefs::kSyncTabs; | 342 return prefs::kSyncTabs; |
| 343 case syncer::PRIORITY_PREFERENCES: |
| 344 return prefs::kSyncPriorityPreferences; |
| 343 default: | 345 default: |
| 344 break; | 346 break; |
| 345 } | 347 } |
| 346 NOTREACHED(); | 348 NOTREACHED(); |
| 347 return NULL; | 349 return NULL; |
| 348 } | 350 } |
| 349 | 351 |
| 350 #if defined(OS_CHROMEOS) | 352 #if defined(OS_CHROMEOS) |
| 351 std::string SyncPrefs::GetSpareBootstrapToken() const { | 353 std::string SyncPrefs::GetSpareBootstrapToken() const { |
| 352 DCHECK(CalledOnValidThread()); | 354 DCHECK(CalledOnValidThread()); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 | 400 |
| 399 void SyncPrefs::RegisterPrefGroups() { | 401 void SyncPrefs::RegisterPrefGroups() { |
| 400 pref_groups_[syncer::APPS].Put(syncer::APP_NOTIFICATIONS); | 402 pref_groups_[syncer::APPS].Put(syncer::APP_NOTIFICATIONS); |
| 401 pref_groups_[syncer::APPS].Put(syncer::APP_SETTINGS); | 403 pref_groups_[syncer::APPS].Put(syncer::APP_SETTINGS); |
| 402 | 404 |
| 403 pref_groups_[syncer::AUTOFILL].Put(syncer::AUTOFILL_PROFILE); | 405 pref_groups_[syncer::AUTOFILL].Put(syncer::AUTOFILL_PROFILE); |
| 404 | 406 |
| 405 pref_groups_[syncer::EXTENSIONS].Put(syncer::EXTENSION_SETTINGS); | 407 pref_groups_[syncer::EXTENSIONS].Put(syncer::EXTENSION_SETTINGS); |
| 406 | 408 |
| 407 pref_groups_[syncer::PREFERENCES].Put(syncer::DICTIONARY); | 409 pref_groups_[syncer::PREFERENCES].Put(syncer::DICTIONARY); |
| 410 pref_groups_[syncer::PREFERENCES].Put(syncer::PRIORITY_PREFERENCES); |
| 408 pref_groups_[syncer::PREFERENCES].Put(syncer::SEARCH_ENGINES); | 411 pref_groups_[syncer::PREFERENCES].Put(syncer::SEARCH_ENGINES); |
| 409 | 412 |
| 410 pref_groups_[syncer::TYPED_URLS].Put(syncer::HISTORY_DELETE_DIRECTIVES); | 413 pref_groups_[syncer::TYPED_URLS].Put(syncer::HISTORY_DELETE_DIRECTIVES); |
| 411 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 414 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 412 if (command_line.HasSwitch(switches::kHistoryEnableFullHistorySync)) { | 415 if (command_line.HasSwitch(switches::kHistoryEnableFullHistorySync)) { |
| 413 pref_groups_[syncer::TYPED_URLS].Put(syncer::SESSIONS); | 416 pref_groups_[syncer::TYPED_URLS].Put(syncer::SESSIONS); |
| 414 pref_groups_[syncer::TYPED_URLS].Put(syncer::FAVICON_IMAGES); | 417 pref_groups_[syncer::TYPED_URLS].Put(syncer::FAVICON_IMAGES); |
| 415 pref_groups_[syncer::TYPED_URLS].Put(syncer::FAVICON_TRACKING); | 418 pref_groups_[syncer::TYPED_URLS].Put(syncer::FAVICON_TRACKING); |
| 416 } | 419 } |
| 417 | 420 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 for (PrefGroupsMap::const_iterator i = pref_groups_.begin(); | 480 for (PrefGroupsMap::const_iterator i = pref_groups_.begin(); |
| 478 i != pref_groups_.end(); ++i) { | 481 i != pref_groups_.end(); ++i) { |
| 479 if (types.Has(i->first)) | 482 if (types.Has(i->first)) |
| 480 types_with_groups.PutAll(i->second); | 483 types_with_groups.PutAll(i->second); |
| 481 } | 484 } |
| 482 types_with_groups.RetainAll(registered_types); | 485 types_with_groups.RetainAll(registered_types); |
| 483 return types_with_groups; | 486 return types_with_groups; |
| 484 } | 487 } |
| 485 | 488 |
| 486 } // namespace browser_sync | 489 } // namespace browser_sync |
| OLD | NEW |