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 "components/syncable_prefs/pref_model_associator.h" | 5 #include "components/syncable_prefs/pref_model_associator.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
11 #include "base/json/json_string_value_serializer.h" | 11 #include "base/json/json_string_value_serializer.h" |
12 #include "base/location.h" | 12 #include "base/location.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
15 #include "base/stl_util.h" | 15 #include "base/stl_util.h" |
16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
17 #include "base/values.h" | 17 #include "base/values.h" |
18 #include "components/prefs/pref_service.h" | 18 #include "components/prefs/pref_service.h" |
| 19 #include "components/sync/api/sync_change.h" |
| 20 #include "components/sync/api/sync_error_factory.h" |
| 21 #include "components/sync/protocol/preference_specifics.pb.h" |
| 22 #include "components/sync/protocol/sync.pb.h" |
19 #include "components/syncable_prefs/pref_model_associator_client.h" | 23 #include "components/syncable_prefs/pref_model_associator_client.h" |
20 #include "components/syncable_prefs/pref_service_syncable.h" | 24 #include "components/syncable_prefs/pref_service_syncable.h" |
21 #include "sync/api/sync_change.h" | |
22 #include "sync/api/sync_error_factory.h" | |
23 #include "sync/protocol/preference_specifics.pb.h" | |
24 #include "sync/protocol/sync.pb.h" | |
25 | 25 |
26 using syncer::PREFERENCES; | 26 using syncer::PREFERENCES; |
27 using syncer::PRIORITY_PREFERENCES; | 27 using syncer::PRIORITY_PREFERENCES; |
28 | 28 |
29 namespace syncable_prefs { | 29 namespace syncable_prefs { |
30 | 30 |
31 namespace { | 31 namespace { |
32 | 32 |
33 const sync_pb::PreferenceSpecifics& GetSpecifics(const syncer::SyncData& pref) { | 33 const sync_pb::PreferenceSpecifics& GetSpecifics(const syncer::SyncData& pref) { |
34 DCHECK(pref.GetDataType() == syncer::PREFERENCES || | 34 DCHECK(pref.GetDataType() == syncer::PREFERENCES || |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 SyncedPrefObserverMap::const_iterator observer_iter = | 543 SyncedPrefObserverMap::const_iterator observer_iter = |
544 synced_pref_observers_.find(path); | 544 synced_pref_observers_.find(path); |
545 if (observer_iter == synced_pref_observers_.end()) | 545 if (observer_iter == synced_pref_observers_.end()) |
546 return; | 546 return; |
547 SyncedPrefObserverList* observers = observer_iter->second; | 547 SyncedPrefObserverList* observers = observer_iter->second; |
548 FOR_EACH_OBSERVER(SyncedPrefObserver, *observers, | 548 FOR_EACH_OBSERVER(SyncedPrefObserver, *observers, |
549 OnSyncedPrefChanged(path, from_sync)); | 549 OnSyncedPrefChanged(path, from_sync)); |
550 } | 550 } |
551 | 551 |
552 } // namespace syncable_prefs | 552 } // namespace syncable_prefs |
OLD | NEW |