Index: google_apis/gcm/gcm_client.h |
diff --git a/google_apis/gcm/gcm_client.h b/google_apis/gcm/gcm_client.h |
index 28c9ef2b453d5c837285bbaca997b379ed9c0e38..f83a740025b0f11d0e4dad294ca8422d5798a239 100644 |
--- a/google_apis/gcm/gcm_client.h |
+++ b/google_apis/gcm/gcm_client.h |
@@ -12,6 +12,7 @@ |
#include "base/basictypes.h" |
#include "google_apis/gcm/base/gcm_export.h" |
#include "google_apis/gcm/monitoring/gcm_stats_recorder.h" |
+#include "google_apis/gcm/public/gcm_types.h" |
template <class T> class scoped_refptr; |
@@ -34,61 +35,6 @@ namespace gcm { |
// Messaging server. This interface is not supposed to be thread-safe. |
class GCM_EXPORT GCMClient { |
public: |
- enum Result { |
- // Successful operation. |
- SUCCESS, |
- // Invalid parameter. |
- INVALID_PARAMETER, |
- // Profile not signed in. |
- NOT_SIGNED_IN, |
- // Previous asynchronous operation is still pending to finish. Certain |
- // operation, like register, is only allowed one at a time. |
- ASYNC_OPERATION_PENDING, |
- // Network socket error. |
- NETWORK_ERROR, |
- // Problem at the server. |
- SERVER_ERROR, |
- // Exceeded the specified TTL during message sending. |
- TTL_EXCEEDED, |
- // Other errors. |
- UNKNOWN_ERROR |
- }; |
- |
- // Message data consisting of key-value pairs. |
- typedef std::map<std::string, std::string> MessageData; |
- |
- // Message to be delivered to the other party. |
- struct GCM_EXPORT OutgoingMessage { |
- OutgoingMessage(); |
- ~OutgoingMessage(); |
- |
- // Message ID. |
- std::string id; |
- // In seconds. |
- int time_to_live; |
- MessageData data; |
- }; |
- |
- // Message being received from the other party. |
- struct GCM_EXPORT IncomingMessage { |
- IncomingMessage(); |
- ~IncomingMessage(); |
- |
- MessageData data; |
- std::string collapse_key; |
- std::string sender_id; |
- }; |
- |
- // Detailed information of the Send Error event. |
- struct GCM_EXPORT SendErrorDetails { |
- SendErrorDetails(); |
- ~SendErrorDetails(); |
- |
- std::string message_id; |
- MessageData additional_data; |
- Result result; |
- }; |
- |
// Internal states and activity statistics of a GCM client. |
struct GCM_EXPORT GCMStatistics { |
public: |
@@ -124,7 +70,7 @@ class GCM_EXPORT GCMClient { |
// |app_id|: application ID. |
// |result|: result of the unregistration. |
virtual void OnUnregisterFinished(const std::string& app_id, |
- GCMClient::Result result) = 0; |
+ Result result) = 0; |
// Called when the message is scheduled to send successfully or an error |
// occurs. |