Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service.cc

Issue 1131113004: Convert JsonWriter::Write to taking a const ref for the in-param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 registry->RegisterDictionaryPref(prefs::kSupervisedUserSharedSettings); 167 registry->RegisterDictionaryPref(prefs::kSupervisedUserSharedSettings);
168 } 168 }
169 169
170 // static 170 // static
171 SyncData SupervisedUserSharedSettingsService::CreateSyncDataForSetting( 171 SyncData SupervisedUserSharedSettingsService::CreateSyncDataForSetting(
172 const std::string& su_id, 172 const std::string& su_id,
173 const std::string& key, 173 const std::string& key,
174 const Value& value, 174 const Value& value,
175 bool acknowledged) { 175 bool acknowledged) {
176 std::string json_value; 176 std::string json_value;
177 base::JSONWriter::Write(&value, &json_value); 177 base::JSONWriter::Write(value, &json_value);
178 ::sync_pb::EntitySpecifics specifics; 178 ::sync_pb::EntitySpecifics specifics;
179 specifics.mutable_managed_user_shared_setting()->set_mu_id(su_id); 179 specifics.mutable_managed_user_shared_setting()->set_mu_id(su_id);
180 specifics.mutable_managed_user_shared_setting()->set_key(key); 180 specifics.mutable_managed_user_shared_setting()->set_key(key);
181 specifics.mutable_managed_user_shared_setting()->set_value(json_value); 181 specifics.mutable_managed_user_shared_setting()->set_value(json_value);
182 specifics.mutable_managed_user_shared_setting()->set_acknowledged( 182 specifics.mutable_managed_user_shared_setting()->set_acknowledged(
183 acknowledged); 183 acknowledged);
184 std::string title = su_id + ":" + key; 184 std::string title = su_id + ":" + key;
185 return SyncData::CreateLocalData(title, title, specifics); 185 return SyncData::CreateLocalData(title, title, specifics);
186 } 186 }
187 187
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 NOTREACHED(); 336 NOTREACHED();
337 break; 337 break;
338 } 338 }
339 } 339 }
340 callbacks_.Notify(su_id, key); 340 callbacks_.Notify(su_id, key);
341 } 341 }
342 342
343 SyncError error; 343 SyncError error;
344 return error; 344 return error;
345 } 345 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698