OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |