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/legacy/supervised_user_shared_settings_
service.h" | 5 #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_
service.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 scoped_ptr< | 157 scoped_ptr< |
158 SupervisedUserSharedSettingsService::ChangeCallbackList::Subscription> | 158 SupervisedUserSharedSettingsService::ChangeCallbackList::Subscription> |
159 SupervisedUserSharedSettingsService::Subscribe( | 159 SupervisedUserSharedSettingsService::Subscribe( |
160 const SupervisedUserSharedSettingsService::ChangeCallback& cb) { | 160 const SupervisedUserSharedSettingsService::ChangeCallback& cb) { |
161 return callbacks_.Add(cb); | 161 return callbacks_.Add(cb); |
162 } | 162 } |
163 | 163 |
164 // static | 164 // static |
165 void SupervisedUserSharedSettingsService::RegisterProfilePrefs( | 165 void SupervisedUserSharedSettingsService::RegisterProfilePrefs( |
166 user_prefs::PrefRegistrySyncable* registry) { | 166 user_prefs::PrefRegistrySyncable* registry) { |
167 registry->RegisterDictionaryPref( | 167 registry->RegisterDictionaryPref(prefs::kSupervisedUserSharedSettings); |
168 prefs::kSupervisedUserSharedSettings, | |
169 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
170 } | 168 } |
171 | 169 |
172 // static | 170 // static |
173 SyncData SupervisedUserSharedSettingsService::CreateSyncDataForSetting( | 171 SyncData SupervisedUserSharedSettingsService::CreateSyncDataForSetting( |
174 const std::string& su_id, | 172 const std::string& su_id, |
175 const std::string& key, | 173 const std::string& key, |
176 const Value& value, | 174 const Value& value, |
177 bool acknowledged) { | 175 bool acknowledged) { |
178 std::string json_value; | 176 std::string json_value; |
179 base::JSONWriter::Write(&value, &json_value); | 177 base::JSONWriter::Write(&value, &json_value); |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 NOTREACHED(); | 336 NOTREACHED(); |
339 break; | 337 break; |
340 } | 338 } |
341 } | 339 } |
342 callbacks_.Notify(su_id, key); | 340 callbacks_.Notify(su_id, key); |
343 } | 341 } |
344 | 342 |
345 SyncError error; | 343 SyncError error; |
346 return error; | 344 return error; |
347 } | 345 } |
OLD | NEW |