| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/prefs/synced_pref_change_registrar.h" | 5 #include "components/syncable_prefs/synced_pref_change_registrar.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 | 8 |
| 9 namespace { | 9 namespace { |
| 10 | 10 |
| 11 void InvokeUnnamedCallback( | 11 void InvokeUnnamedCallback( |
| 12 const SyncedPrefChangeRegistrar::ChangeCallback& callback, | 12 const SyncedPrefChangeRegistrar::ChangeCallback& callback, |
| 13 const std::string& path, | 13 const std::string& path, |
| 14 bool from_sync) { | 14 bool from_sync) { |
| 15 callback.Run(from_sync); | 15 callback.Run(from_sync); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 void SyncedPrefChangeRegistrar::OnSyncedPrefChanged(const std::string& path, | 58 void SyncedPrefChangeRegistrar::OnSyncedPrefChanged(const std::string& path, |
| 59 bool from_sync) { | 59 bool from_sync) { |
| 60 if (pref_service_->IsManagedPreference(path.c_str())) | 60 if (pref_service_->IsManagedPreference(path.c_str())) |
| 61 return; | 61 return; |
| 62 ObserverMap::const_iterator iter = observers_.find(path); | 62 ObserverMap::const_iterator iter = observers_.find(path); |
| 63 if (iter == observers_.end()) | 63 if (iter == observers_.end()) |
| 64 return; | 64 return; |
| 65 iter->second.Run(path, from_sync); | 65 iter->second.Run(path, from_sync); |
| 66 } | 66 } |
| OLD | NEW |