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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 const sync_pb::ExtensionSpecifics& BaseNode::GetExtensionSpecifics() const { | 322 const sync_pb::ExtensionSpecifics& BaseNode::GetExtensionSpecifics() const { |
323 DCHECK_EQ(GetModelType(), EXTENSIONS); | 323 DCHECK_EQ(GetModelType(), EXTENSIONS); |
324 return GetEntitySpecifics().extension(); | 324 return GetEntitySpecifics().extension(); |
325 } | 325 } |
326 | 326 |
327 const sync_pb::SessionSpecifics& BaseNode::GetSessionSpecifics() const { | 327 const sync_pb::SessionSpecifics& BaseNode::GetSessionSpecifics() const { |
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& |
| 333 BaseNode::GetManagedUserSettingSpecifics() const { |
| 334 DCHECK_EQ(GetModelType(), MANAGED_USER_SETTINGS); |
| 335 return GetEntitySpecifics().managed_user_setting(); |
| 336 } |
| 337 |
332 const sync_pb::DeviceInfoSpecifics& BaseNode::GetDeviceInfoSpecifics() const { | 338 const sync_pb::DeviceInfoSpecifics& BaseNode::GetDeviceInfoSpecifics() const { |
333 DCHECK_EQ(GetModelType(), DEVICE_INFO); | 339 DCHECK_EQ(GetModelType(), DEVICE_INFO); |
334 return GetEntitySpecifics().device_info(); | 340 return GetEntitySpecifics().device_info(); |
335 } | 341 } |
336 | 342 |
337 const sync_pb::ExperimentsSpecifics& BaseNode::GetExperimentsSpecifics() const { | 343 const sync_pb::ExperimentsSpecifics& BaseNode::GetExperimentsSpecifics() const { |
338 DCHECK_EQ(GetModelType(), EXPERIMENTS); | 344 DCHECK_EQ(GetModelType(), EXPERIMENTS); |
339 return GetEntitySpecifics().experiments(); | 345 return GetEntitySpecifics().experiments(); |
340 } | 346 } |
341 | 347 |
(...skipping 15 matching lines...) Expand all Loading... |
357 const sync_pb::EntitySpecifics& specifics) { | 363 const sync_pb::EntitySpecifics& specifics) { |
358 ModelType type = GetModelTypeFromSpecifics(specifics); | 364 ModelType type = GetModelTypeFromSpecifics(specifics); |
359 DCHECK_NE(UNSPECIFIED, type); | 365 DCHECK_NE(UNSPECIFIED, type); |
360 if (GetModelType() != UNSPECIFIED) { | 366 if (GetModelType() != UNSPECIFIED) { |
361 DCHECK_EQ(GetModelType(), type); | 367 DCHECK_EQ(GetModelType(), type); |
362 } | 368 } |
363 unencrypted_data_.CopyFrom(specifics); | 369 unencrypted_data_.CopyFrom(specifics); |
364 } | 370 } |
365 | 371 |
366 } // namespace syncer | 372 } // namespace syncer |
OLD | NEW |