| 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/policy/core/common/policy_service.h" | 5 #include "components/policy/core/common/policy_service.h" |
| 6 | 6 |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 | 8 |
| 9 namespace policy { | 9 namespace policy { |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 callback_map_[policy_name] = callback; | 25 callback_map_[policy_name] = callback; |
| 26 } | 26 } |
| 27 | 27 |
| 28 void PolicyChangeRegistrar::OnPolicyUpdated(const PolicyNamespace& ns, | 28 void PolicyChangeRegistrar::OnPolicyUpdated(const PolicyNamespace& ns, |
| 29 const PolicyMap& previous, | 29 const PolicyMap& previous, |
| 30 const PolicyMap& current) { | 30 const PolicyMap& current) { |
| 31 if (ns != ns_) | 31 if (ns != ns_) |
| 32 return; | 32 return; |
| 33 for (CallbackMap::iterator it = callback_map_.begin(); | 33 for (CallbackMap::iterator it = callback_map_.begin(); |
| 34 it != callback_map_.end(); ++it) { | 34 it != callback_map_.end(); ++it) { |
| 35 const Value* prev = previous.GetValue(it->first); | 35 const base::Value* prev = previous.GetValue(it->first); |
| 36 const Value* cur = current.GetValue(it->first); | 36 const base::Value* cur = current.GetValue(it->first); |
| 37 if (!base::Value::Equals(prev, cur)) | 37 if (!base::Value::Equals(prev, cur)) |
| 38 it->second.Run(prev, cur); | 38 it->second.Run(prev, cur); |
| 39 } | 39 } |
| 40 } | 40 } |
| 41 | 41 |
| 42 } // namespace policy | 42 } // namespace policy |
| OLD | NEW |