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 "chrome/browser/prefs/synced_pref_change_registrar.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "chrome/browser/prefs/pref_service_syncable.h" |
8 | 9 |
9 namespace { | 10 namespace { |
10 | 11 |
11 void InvokeUnnamedCallback( | 12 void InvokeUnnamedCallback( |
12 const SyncedPrefChangeRegistrar::ChangeCallback& callback, | 13 const SyncedPrefChangeRegistrar::ChangeCallback& callback, |
13 const std::string& path, | 14 const std::string& path, |
14 bool from_sync) { | 15 bool from_sync) { |
15 callback.Run(from_sync); | 16 callback.Run(from_sync); |
16 } | 17 } |
17 | 18 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 58 |
58 void SyncedPrefChangeRegistrar::OnSyncedPrefChanged(const std::string& path, | 59 void SyncedPrefChangeRegistrar::OnSyncedPrefChanged(const std::string& path, |
59 bool from_sync) { | 60 bool from_sync) { |
60 if (pref_service_->IsManagedPreference(path.c_str())) | 61 if (pref_service_->IsManagedPreference(path.c_str())) |
61 return; | 62 return; |
62 ObserverMap::const_iterator iter = observers_.find(path); | 63 ObserverMap::const_iterator iter = observers_.find(path); |
63 if (iter == observers_.end()) | 64 if (iter == observers_.end()) |
64 return; | 65 return; |
65 iter->second.Run(path, from_sync); | 66 iter->second.Run(path, from_sync); |
66 } | 67 } |
OLD | NEW |