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