OLD | NEW |
| (Empty) |
1 // Copyright 2014 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 "components/sync/engine/events/configure_get_updates_request_event.h" | |
6 | |
7 #include "base/strings/stringprintf.h" | |
8 #include "components/sync/protocol/proto_enum_conversions.h" | |
9 #include "components/sync/protocol/proto_value_conversions.h" | |
10 | |
11 namespace syncer { | |
12 | |
13 ConfigureGetUpdatesRequestEvent::ConfigureGetUpdatesRequestEvent( | |
14 base::Time timestamp, | |
15 sync_pb::SyncEnums::GetUpdatesOrigin origin, | |
16 const sync_pb::ClientToServerMessage& request) | |
17 : timestamp_(timestamp), origin_(origin), request_(request) {} | |
18 | |
19 ConfigureGetUpdatesRequestEvent::~ConfigureGetUpdatesRequestEvent() {} | |
20 | |
21 base::Time ConfigureGetUpdatesRequestEvent::GetTimestamp() const { | |
22 return timestamp_; | |
23 } | |
24 | |
25 std::string ConfigureGetUpdatesRequestEvent::GetType() const { | |
26 return "Initial GetUpdates"; | |
27 } | |
28 | |
29 std::string ConfigureGetUpdatesRequestEvent::GetDetails() const { | |
30 return base::StringPrintf("Reason: %s", ProtoEnumToString(origin_)); | |
31 } | |
32 | |
33 std::unique_ptr<base::DictionaryValue> | |
34 ConfigureGetUpdatesRequestEvent::GetProtoMessage() const { | |
35 return std::unique_ptr<base::DictionaryValue>( | |
36 ClientToServerMessageToValue(request_, false)); | |
37 } | |
38 | |
39 std::unique_ptr<ProtocolEvent> ConfigureGetUpdatesRequestEvent::Clone() const { | |
40 return std::unique_ptr<ProtocolEvent>( | |
41 new ConfigureGetUpdatesRequestEvent(timestamp_, origin_, request_)); | |
42 } | |
43 | |
44 } // namespace syncer | |
OLD | NEW |