| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_INVALIDATION_IMPL_GCM_NETWORK_CHANNEL_DELEGATE_H_ | 5 #ifndef COMPONENTS_INVALIDATION_IMPL_GCM_NETWORK_CHANNEL_DELEGATE_H_ |
| 6 #define COMPONENTS_INVALIDATION_IMPL_GCM_NETWORK_CHANNEL_DELEGATE_H_ | 6 #define COMPONENTS_INVALIDATION_IMPL_GCM_NETWORK_CHANNEL_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 typedef base::Callback<void(const GoogleServiceAuthError& error, | 27 typedef base::Callback<void(const GoogleServiceAuthError& error, |
| 28 const std::string& token)> RequestTokenCallback; | 28 const std::string& token)> RequestTokenCallback; |
| 29 typedef base::Callback<void(const std::string& registration_id, | 29 typedef base::Callback<void(const std::string& registration_id, |
| 30 gcm::GCMClient::Result result)> RegisterCallback; | 30 gcm::GCMClient::Result result)> RegisterCallback; |
| 31 typedef base::Callback<void(const std::string& message, | 31 typedef base::Callback<void(const std::string& message, |
| 32 const std::string& echo_token)> MessageCallback; | 32 const std::string& echo_token)> MessageCallback; |
| 33 typedef base::Callback<void(bool online)> ConnectionStateCallback; | 33 typedef base::Callback<void(bool online)> ConnectionStateCallback; |
| 34 | 34 |
| 35 virtual ~GCMNetworkChannelDelegate() {} | 35 virtual ~GCMNetworkChannelDelegate() {} |
| 36 | 36 |
| 37 virtual void Initialize(ConnectionStateCallback callback) = 0; | 37 virtual void Initialize(ConnectionStateCallback connection_state_callback, |
| 38 base::Closure store_reset_callback) = 0; |
| 38 // Request access token. Callback should be called either with access token or | 39 // Request access token. Callback should be called either with access token or |
| 39 // error code. | 40 // error code. |
| 40 virtual void RequestToken(RequestTokenCallback callback) = 0; | 41 virtual void RequestToken(RequestTokenCallback callback) = 0; |
| 41 // Invalidate access token that was rejected by server. | 42 // Invalidate access token that was rejected by server. |
| 42 virtual void InvalidateToken(const std::string& token) = 0; | 43 virtual void InvalidateToken(const std::string& token) = 0; |
| 43 | 44 |
| 44 // Request registration_id from GCMService. Callback should be called with | 45 // Request registration_id from GCMService. Callback should be called with |
| 45 // either registration id or error code. | 46 // either registration id or error code. |
| 46 virtual void Register(RegisterCallback callback) = 0; | 47 virtual void Register(RegisterCallback callback) = 0; |
| 47 // Provide callback for incoming messages from GCM. | 48 // Provide callback for incoming messages from GCM. |
| 48 virtual void SetMessageReceiver(MessageCallback callback) = 0; | 49 virtual void SetMessageReceiver(MessageCallback callback) = 0; |
| 49 }; | 50 }; |
| 50 } // namespace syncer | 51 } // namespace syncer |
| 51 | 52 |
| 52 #endif // COMPONENTS_INVALIDATION_IMPL_GCM_NETWORK_CHANNEL_DELEGATE_H_ | 53 #endif // COMPONENTS_INVALIDATION_IMPL_GCM_NETWORK_CHANNEL_DELEGATE_H_ |
| OLD | NEW |