Don't show supervised user as "already on this device" while they're being imported.
[chromium-blink-merge.git] / sync / internal_api / events / commit_response_event.cc
blobc263e944adb3fbd24c3187a35c9d9e138230682e
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.
5 #include "sync/internal_api/public/events/commit_response_event.h"
7 #include "base/strings/stringprintf.h"
8 #include "sync/protocol/proto_value_conversions.h"
10 namespace syncer {
12 CommitResponseEvent::CommitResponseEvent(
13 base::Time timestamp,
14 SyncerError result,
15 const sync_pb::ClientToServerResponse& response)
16 : timestamp_(timestamp),
17 result_(result),
18 response_(response) {}
20 CommitResponseEvent::~CommitResponseEvent() {}
22 base::Time CommitResponseEvent::GetTimestamp() const {
23 return timestamp_;
26 std::string CommitResponseEvent::GetType() const {
27 return "Commit Response";
30 std::string CommitResponseEvent::GetDetails() const {
31 return base::StringPrintf("Result: %s", GetSyncerErrorString(result_));
34 scoped_ptr<base::DictionaryValue> CommitResponseEvent::GetProtoMessage() const {
35 return scoped_ptr<base::DictionaryValue>(
36 ClientToServerResponseToValue(response_, false));
39 scoped_ptr<ProtocolEvent> CommitResponseEvent::Clone() const {
40 return scoped_ptr<ProtocolEvent>(
41 new CommitResponseEvent(
42 timestamp_,
43 result_,
44 response_));
47 } // namespace syncer