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

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

Issue 15177003: Add Sync data type for managed users. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 7 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/pref_names.cc ('k') | sync/internal_api/public/base/model_type.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 DCHECK_EQ(GetModelType(), SESSIONS); 328 DCHECK_EQ(GetModelType(), SESSIONS);
329 return GetEntitySpecifics().session(); 329 return GetEntitySpecifics().session();
330 } 330 }
331 331
332 const sync_pb::ManagedUserSettingSpecifics& 332 const sync_pb::ManagedUserSettingSpecifics&
333 BaseNode::GetManagedUserSettingSpecifics() const { 333 BaseNode::GetManagedUserSettingSpecifics() const {
334 DCHECK_EQ(GetModelType(), MANAGED_USER_SETTINGS); 334 DCHECK_EQ(GetModelType(), MANAGED_USER_SETTINGS);
335 return GetEntitySpecifics().managed_user_setting(); 335 return GetEntitySpecifics().managed_user_setting();
336 } 336 }
337 337
338 const sync_pb::ManagedUserSpecifics& BaseNode::GetManagedUserSpecifics() const {
339 DCHECK_EQ(GetModelType(), MANAGED_USERS);
340 return GetEntitySpecifics().managed_user();
341 }
342
338 const sync_pb::DeviceInfoSpecifics& BaseNode::GetDeviceInfoSpecifics() const { 343 const sync_pb::DeviceInfoSpecifics& BaseNode::GetDeviceInfoSpecifics() const {
339 DCHECK_EQ(GetModelType(), DEVICE_INFO); 344 DCHECK_EQ(GetModelType(), DEVICE_INFO);
340 return GetEntitySpecifics().device_info(); 345 return GetEntitySpecifics().device_info();
341 } 346 }
342 347
343 const sync_pb::ExperimentsSpecifics& BaseNode::GetExperimentsSpecifics() const { 348 const sync_pb::ExperimentsSpecifics& BaseNode::GetExperimentsSpecifics() const {
344 DCHECK_EQ(GetModelType(), EXPERIMENTS); 349 DCHECK_EQ(GetModelType(), EXPERIMENTS);
345 return GetEntitySpecifics().experiments(); 350 return GetEntitySpecifics().experiments();
346 } 351 }
347 352
(...skipping 15 matching lines...) Expand all
363 const sync_pb::EntitySpecifics& specifics) { 368 const sync_pb::EntitySpecifics& specifics) {
364 ModelType type = GetModelTypeFromSpecifics(specifics); 369 ModelType type = GetModelTypeFromSpecifics(specifics);
365 DCHECK_NE(UNSPECIFIED, type); 370 DCHECK_NE(UNSPECIFIED, type);
366 if (GetModelType() != UNSPECIFIED) { 371 if (GetModelType() != UNSPECIFIED) {
367 DCHECK_EQ(GetModelType(), type); 372 DCHECK_EQ(GetModelType(), type);
368 } 373 }
369 unencrypted_data_.CopyFrom(specifics); 374 unencrypted_data_.CopyFrom(specifics);
370 } 375 }
371 376
372 } // namespace syncer 377 } // namespace syncer
OLDNEW
« no previous file with comments | « chrome/common/pref_names.cc ('k') | sync/internal_api/public/base/model_type.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698