| 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 #ifndef GOOGLE_APIS_GCM_ENGINE_ACCOUNT_INFO_H_ | |
| 6 #define GOOGLE_APIS_GCM_ENGINE_ACCOUNT_INFO_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/basictypes.h" | |
| 11 #include "base/time/time.h" | |
| 12 #include "google_apis/gcm/base/gcm_export.h" | |
| 13 | |
| 14 namespace gcm { | |
| 15 | |
| 16 // Stores information about Account and a last message sent with the information | |
| 17 // about that account. | |
| 18 struct GCM_EXPORT AccountInfo { | |
| 19 // Indicates whether a message, if sent, was adding or removing account | |
| 20 // mapping. | |
| 21 enum MessageType { | |
| 22 MSG_NONE, // No message has been sent. | |
| 23 MSG_ADD, // Account was mapped to device by the message. | |
| 24 MSG_REMOVE, // Account mapping to device was removed by the message. | |
| 25 }; | |
| 26 | |
| 27 AccountInfo(); | |
| 28 ~AccountInfo(); | |
| 29 | |
| 30 // Serializes account info to string without |account_id|. | |
| 31 std::string SerializeAsString() const; | |
| 32 // Parses account info from store, without |account_id|. | |
| 33 bool ParseFromString(const std::string& value); | |
| 34 | |
| 35 // Gaia ID of the account. | |
| 36 std::string account_id; | |
| 37 // Email address of the tracked account. | |
| 38 std::string email; | |
| 39 // Type of the last mapping message sent to GCM. | |
| 40 MessageType last_message_type; | |
| 41 // ID of the last mapping message sent to GCM. | |
| 42 std::string last_message_id; | |
| 43 // Timestamp of when the last mapping message was sent to GCM. | |
| 44 base::Time last_message_timestamp; | |
| 45 }; | |
| 46 | |
| 47 } // namespace gcm | |
| 48 | |
| 49 #endif // GOOGLE_APIS_GCM_ENGINE_ACCOUNT_INFO_H_ | |
| OLD | NEW |