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> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/prefs/pref_value_map.h" | 10 #include "base/prefs/pref_value_map.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 12 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
13 #include "chrome/browser/supervised_user/supervised_user_constants.h" | 13 #include "chrome/browser/supervised_user/supervised_user_constants.h" |
14 #include "chrome/browser/supervised_user/supervised_user_settings_service.h" | 14 #include "chrome/browser/supervised_user/supervised_user_settings_service.h" |
15 #include "chrome/browser/supervised_user/supervised_user_url_filter.h" | 15 #include "chrome/browser/supervised_user/supervised_user_url_filter.h" |
16 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
17 | 17 |
18 using base::FundamentalValue; | 18 using base::FundamentalValue; |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 struct SupervisedUserSettingsPrefMappingEntry { | 22 struct SupervisedUserSettingsPrefMappingEntry { |
23 const char* settings_name; | 23 const char* settings_name; |
24 const char* pref_name; | 24 const char* pref_name; |
25 }; | 25 }; |
26 | 26 |
27 SupervisedUserSettingsPrefMappingEntry kSupervisedUserSettingsPrefMapping[] = { | 27 SupervisedUserSettingsPrefMappingEntry kSupervisedUserSettingsPrefMapping[] = { |
28 { | 28 { |
| 29 supervised_users::kCameraMicDisabled, prefs::kSupervisedCameraMicDisabled, |
| 30 }, |
| 31 { |
29 supervised_users::kContentPackDefaultFilteringBehavior, | 32 supervised_users::kContentPackDefaultFilteringBehavior, |
30 prefs::kDefaultSupervisedUserFilteringBehavior, | 33 prefs::kDefaultSupervisedUserFilteringBehavior, |
31 }, | 34 }, |
32 { | 35 { |
33 supervised_users::kContentPackManualBehaviorHosts, | 36 supervised_users::kContentPackManualBehaviorHosts, |
34 prefs::kSupervisedUserManualHosts, | 37 prefs::kSupervisedUserManualHosts, |
35 }, | 38 }, |
36 { | 39 { |
37 supervised_users::kContentPackManualBehaviorURLs, | 40 supervised_users::kContentPackManualBehaviorURLs, |
38 prefs::kSupervisedUserManualURLs, | 41 prefs::kSupervisedUserManualURLs, |
39 }, | 42 }, |
40 { | 43 { |
41 supervised_users::kForceSafeSearch, prefs::kForceSafeSearch, | 44 supervised_users::kForceSafeSearch, prefs::kForceSafeSearch, |
42 }, | 45 }, |
43 { | 46 { |
| 47 supervised_users::kGeolocationDisabled, |
| 48 prefs::kSupervisedGeolocationDisabled, |
| 49 }, |
| 50 { |
44 supervised_users::kRecordHistory, prefs::kRecordHistory, | 51 supervised_users::kRecordHistory, prefs::kRecordHistory, |
45 }, | 52 }, |
46 { | 53 { |
47 supervised_users::kSigninAllowed, prefs::kSigninAllowed, | 54 supervised_users::kSigninAllowed, prefs::kSigninAllowed, |
48 }, | 55 }, |
49 { | 56 { |
50 supervised_users::kUserName, prefs::kProfileName, | 57 supervised_users::kUserName, prefs::kProfileName, |
51 }, | 58 }, |
52 }; | 59 }; |
53 | 60 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 } | 133 } |
127 | 134 |
128 std::vector<std::string> changed_prefs; | 135 std::vector<std::string> changed_prefs; |
129 prefs_->GetDifferingKeys(old_prefs.get(), &changed_prefs); | 136 prefs_->GetDifferingKeys(old_prefs.get(), &changed_prefs); |
130 | 137 |
131 // Send out change notifications. | 138 // Send out change notifications. |
132 for (const std::string& pref : changed_prefs) { | 139 for (const std::string& pref : changed_prefs) { |
133 FOR_EACH_OBSERVER(Observer, observers_, OnPrefValueChanged(pref)); | 140 FOR_EACH_OBSERVER(Observer, observers_, OnPrefValueChanged(pref)); |
134 } | 141 } |
135 } | 142 } |
OLD | NEW |