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

Side by Side Diff: sync/internal_api/base_node.cc

Issue 76333002: Add Sync datatype for shared managed user settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 years 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 | Annotate | Revision Log
OLDNEW
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 "sync/internal_api/public/base_node.h" 5 #include "sync/internal_api/public/base_node.h"
6 6
7 #include <stack> 7 #include <stack>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 BaseNode::GetManagedUserSettingSpecifics() const { 317 BaseNode::GetManagedUserSettingSpecifics() const {
318 DCHECK_EQ(GetModelType(), MANAGED_USER_SETTINGS); 318 DCHECK_EQ(GetModelType(), MANAGED_USER_SETTINGS);
319 return GetEntitySpecifics().managed_user_setting(); 319 return GetEntitySpecifics().managed_user_setting();
320 } 320 }
321 321
322 const sync_pb::ManagedUserSpecifics& BaseNode::GetManagedUserSpecifics() const { 322 const sync_pb::ManagedUserSpecifics& BaseNode::GetManagedUserSpecifics() const {
323 DCHECK_EQ(GetModelType(), MANAGED_USERS); 323 DCHECK_EQ(GetModelType(), MANAGED_USERS);
324 return GetEntitySpecifics().managed_user(); 324 return GetEntitySpecifics().managed_user();
325 } 325 }
326 326
327 const sync_pb::ManagedUserSharedSettingSpecifics&
328 BaseNode::GetManagedUserSharedSettingSpecifics() const {
329 DCHECK_EQ(GetModelType(), MANAGED_USER_SHARED_SETTINGS);
330 return GetEntitySpecifics().managed_user_shared_setting();
331 }
332
327 const sync_pb::DeviceInfoSpecifics& BaseNode::GetDeviceInfoSpecifics() const { 333 const sync_pb::DeviceInfoSpecifics& BaseNode::GetDeviceInfoSpecifics() const {
328 DCHECK_EQ(GetModelType(), DEVICE_INFO); 334 DCHECK_EQ(GetModelType(), DEVICE_INFO);
329 return GetEntitySpecifics().device_info(); 335 return GetEntitySpecifics().device_info();
330 } 336 }
331 337
332 const sync_pb::ExperimentsSpecifics& BaseNode::GetExperimentsSpecifics() const { 338 const sync_pb::ExperimentsSpecifics& BaseNode::GetExperimentsSpecifics() const {
333 DCHECK_EQ(GetModelType(), EXPERIMENTS); 339 DCHECK_EQ(GetModelType(), EXPERIMENTS);
334 return GetEntitySpecifics().experiments(); 340 return GetEntitySpecifics().experiments();
335 } 341 }
336 342
(...skipping 15 matching lines...) Expand all
352 const sync_pb::EntitySpecifics& specifics) { 358 const sync_pb::EntitySpecifics& specifics) {
353 ModelType type = GetModelTypeFromSpecifics(specifics); 359 ModelType type = GetModelTypeFromSpecifics(specifics);
354 DCHECK_NE(UNSPECIFIED, type); 360 DCHECK_NE(UNSPECIFIED, type);
355 if (GetModelType() != UNSPECIFIED) { 361 if (GetModelType() != UNSPECIFIED) {
356 DCHECK_EQ(GetModelType(), type); 362 DCHECK_EQ(GetModelType(), type);
357 } 363 }
358 unencrypted_data_.CopyFrom(specifics); 364 unencrypted_data_.CopyFrom(specifics);
359 } 365 }
360 366
361 } // namespace syncer 367 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698