OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/supervised_user/supervised_user_pref_store.h" | 5 #include "chrome/browser/supervised_user/supervised_user_pref_store.h" |
6 | 6 |
| 7 #include <vector> |
| 8 |
7 #include "base/bind.h" | 9 #include "base/bind.h" |
8 #include "base/prefs/pref_value_map.h" | 10 #include "base/prefs/pref_value_map.h" |
9 #include "base/values.h" | 11 #include "base/values.h" |
10 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 12 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
11 #include "chrome/browser/supervised_user/supervised_user_constants.h" | 13 #include "chrome/browser/supervised_user/supervised_user_constants.h" |
12 #include "chrome/browser/supervised_user/supervised_user_settings_service.h" | 14 #include "chrome/browser/supervised_user/supervised_user_settings_service.h" |
13 #include "chrome/browser/supervised_user/supervised_user_url_filter.h" | 15 #include "chrome/browser/supervised_user/supervised_user_url_filter.h" |
14 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
15 | 17 |
16 using base::FundamentalValue; | 18 using base::FundamentalValue; |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 114 |
113 if (!old_prefs) { | 115 if (!old_prefs) { |
114 FOR_EACH_OBSERVER(Observer, observers_, OnInitializationCompleted(true)); | 116 FOR_EACH_OBSERVER(Observer, observers_, OnInitializationCompleted(true)); |
115 return; | 117 return; |
116 } | 118 } |
117 | 119 |
118 std::vector<std::string> changed_prefs; | 120 std::vector<std::string> changed_prefs; |
119 prefs_->GetDifferingKeys(old_prefs.get(), &changed_prefs); | 121 prefs_->GetDifferingKeys(old_prefs.get(), &changed_prefs); |
120 | 122 |
121 // Send out change notifications. | 123 // Send out change notifications. |
122 for (std::vector<std::string>::const_iterator pref(changed_prefs.begin()); | 124 for (const std::string& pref : changed_prefs) { |
123 pref != changed_prefs.end(); | 125 FOR_EACH_OBSERVER(Observer, observers_, OnPrefValueChanged(pref)); |
124 ++pref) { | |
125 FOR_EACH_OBSERVER(Observer, observers_, OnPrefValueChanged(*pref)); | |
126 } | 126 } |
127 } | 127 } |
OLD | NEW |