| 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/sessions/sync_source_info.h" | 5 #include "sync/internal_api/public/sessions/sync_source_info.h" |
| 6 | 6 |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "sync/protocol/proto_enum_conversions.h" | 8 #include "sync/protocol/proto_enum_conversions.h" |
| 9 | 9 |
| 10 namespace csync { | 10 namespace syncer { |
| 11 namespace sessions { | 11 namespace sessions { |
| 12 | 12 |
| 13 SyncSourceInfo::SyncSourceInfo() | 13 SyncSourceInfo::SyncSourceInfo() |
| 14 : updates_source(sync_pb::GetUpdatesCallerInfo::UNKNOWN) {} | 14 : updates_source(sync_pb::GetUpdatesCallerInfo::UNKNOWN) {} |
| 15 | 15 |
| 16 SyncSourceInfo::SyncSourceInfo( | 16 SyncSourceInfo::SyncSourceInfo( |
| 17 const syncable::ModelTypePayloadMap& t) | 17 const syncable::ModelTypePayloadMap& t) |
| 18 : updates_source(sync_pb::GetUpdatesCallerInfo::UNKNOWN), types(t) {} | 18 : updates_source(sync_pb::GetUpdatesCallerInfo::UNKNOWN), types(t) {} |
| 19 | 19 |
| 20 SyncSourceInfo::SyncSourceInfo( | 20 SyncSourceInfo::SyncSourceInfo( |
| 21 const sync_pb::GetUpdatesCallerInfo::GetUpdatesSource& u, | 21 const sync_pb::GetUpdatesCallerInfo::GetUpdatesSource& u, |
| 22 const syncable::ModelTypePayloadMap& t) | 22 const syncable::ModelTypePayloadMap& t) |
| 23 : updates_source(u), types(t) {} | 23 : updates_source(u), types(t) {} |
| 24 | 24 |
| 25 SyncSourceInfo::~SyncSourceInfo() {} | 25 SyncSourceInfo::~SyncSourceInfo() {} |
| 26 | 26 |
| 27 DictionaryValue* SyncSourceInfo::ToValue() const { | 27 DictionaryValue* SyncSourceInfo::ToValue() const { |
| 28 DictionaryValue* value = new DictionaryValue(); | 28 DictionaryValue* value = new DictionaryValue(); |
| 29 value->SetString("updatesSource", | 29 value->SetString("updatesSource", |
| 30 GetUpdatesSourceString(updates_source)); | 30 GetUpdatesSourceString(updates_source)); |
| 31 value->Set("types", syncable::ModelTypePayloadMapToValue(types)); | 31 value->Set("types", syncable::ModelTypePayloadMapToValue(types)); |
| 32 return value; | 32 return value; |
| 33 } | 33 } |
| 34 | 34 |
| 35 } // namespace sessions | 35 } // namespace sessions |
| 36 } // namespace csync | 36 } // namespace syncer |
| OLD | NEW |