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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 case syncer::SEARCH_ENGINES: | 225 case syncer::SEARCH_ENGINES: |
226 return prefs::kSyncSearchEngines; | 226 return prefs::kSyncSearchEngines; |
227 case syncer::SESSIONS: | 227 case syncer::SESSIONS: |
228 return prefs::kSyncSessions; | 228 return prefs::kSyncSessions; |
229 case syncer::APP_NOTIFICATIONS: | 229 case syncer::APP_NOTIFICATIONS: |
230 return prefs::kSyncAppNotifications; | 230 return prefs::kSyncAppNotifications; |
231 case syncer::HISTORY_DELETE_DIRECTIVES: | 231 case syncer::HISTORY_DELETE_DIRECTIVES: |
232 return prefs::kSyncHistoryDeleteDirectives; | 232 return prefs::kSyncHistoryDeleteDirectives; |
233 case syncer::SYNCED_NOTIFICATIONS: | 233 case syncer::SYNCED_NOTIFICATIONS: |
234 return prefs::kSyncSyncedNotifications; | 234 return prefs::kSyncSyncedNotifications; |
| 235 case syncer::DICTIONARY: |
| 236 return prefs::kSyncDictionary; |
235 default: | 237 default: |
236 break; | 238 break; |
237 } | 239 } |
238 NOTREACHED(); | 240 NOTREACHED(); |
239 return NULL; | 241 return NULL; |
240 } | 242 } |
241 | 243 |
242 #if defined(OS_CHROMEOS) | 244 #if defined(OS_CHROMEOS) |
243 std::string SyncPrefs::GetSpareBootstrapToken() const { | 245 std::string SyncPrefs::GetSpareBootstrapToken() const { |
244 DCHECK(CalledOnValidThread()); | 246 DCHECK(CalledOnValidThread()); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 } | 291 } |
290 | 292 |
291 void SyncPrefs::RegisterPrefGroups() { | 293 void SyncPrefs::RegisterPrefGroups() { |
292 pref_groups_[syncer::APPS].Put(syncer::APP_NOTIFICATIONS); | 294 pref_groups_[syncer::APPS].Put(syncer::APP_NOTIFICATIONS); |
293 pref_groups_[syncer::APPS].Put(syncer::APP_SETTINGS); | 295 pref_groups_[syncer::APPS].Put(syncer::APP_SETTINGS); |
294 | 296 |
295 pref_groups_[syncer::AUTOFILL].Put(syncer::AUTOFILL_PROFILE); | 297 pref_groups_[syncer::AUTOFILL].Put(syncer::AUTOFILL_PROFILE); |
296 | 298 |
297 pref_groups_[syncer::EXTENSIONS].Put(syncer::EXTENSION_SETTINGS); | 299 pref_groups_[syncer::EXTENSIONS].Put(syncer::EXTENSION_SETTINGS); |
298 | 300 |
| 301 pref_groups_[syncer::PREFERENCES].Put(syncer::DICTIONARY); |
299 pref_groups_[syncer::PREFERENCES].Put(syncer::SEARCH_ENGINES); | 302 pref_groups_[syncer::PREFERENCES].Put(syncer::SEARCH_ENGINES); |
300 | 303 |
301 // TODO(akalin): Revisit this once UI lands. | 304 // TODO(akalin): Revisit this once UI lands. |
302 pref_groups_[syncer::SESSIONS].Put(syncer::HISTORY_DELETE_DIRECTIVES); | 305 pref_groups_[syncer::SESSIONS].Put(syncer::HISTORY_DELETE_DIRECTIVES); |
303 } | 306 } |
304 | 307 |
305 void SyncPrefs::RegisterPreferences() { | 308 void SyncPrefs::RegisterPreferences() { |
306 DCHECK(CalledOnValidThread()); | 309 DCHECK(CalledOnValidThread()); |
307 CHECK(pref_service_); | 310 CHECK(pref_service_); |
308 if (pref_service_->FindPreference(prefs::kSyncLastSyncedTime)) { | 311 if (pref_service_->FindPreference(prefs::kSyncLastSyncedTime)) { |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 if (types.Has(i->first)) | 437 if (types.Has(i->first)) |
435 types_with_groups.PutAll(i->second); | 438 types_with_groups.PutAll(i->second); |
436 else | 439 else |
437 types_with_groups.RemoveAll(i->second); | 440 types_with_groups.RemoveAll(i->second); |
438 } | 441 } |
439 types_with_groups.RetainAll(registered_types); | 442 types_with_groups.RetainAll(registered_types); |
440 return types_with_groups; | 443 return types_with_groups; |
441 } | 444 } |
442 | 445 |
443 } // namespace browser_sync | 446 } // namespace browser_sync |
OLD | NEW |