Index: components/gcm_driver/gcm_driver.h |
diff --git a/components/gcm_driver/gcm_driver.h b/components/gcm_driver/gcm_driver.h |
index aac0975fbd351c0eb605c354ec73b702e59726ec..e8dc7eb938799592f93ac67e7ce166ab70b656b3 100644 |
--- a/components/gcm_driver/gcm_driver.h |
+++ b/components/gcm_driver/gcm_driver.h |
@@ -22,15 +22,30 @@ class GCMAppHandler; |
class GCMConnectionObserver; |
struct AccountMapping; |
-// Provides the capability to set/get InstanceID data in the GCM store. |
-class InstanceIDStore { |
+// Provides the InstanceID support via GCMDriver. |
+class InstanceIDHandler { |
public: |
+ typedef base::Callback<void(const std::string& token, |
+ GCMClient::Result result)> GetTokenCallback; |
+ typedef base::Callback<void(GCMClient::Result result)> DeleteTokenCallback; |
typedef base::Callback<void(const std::string& instance_id_data)> |
GetInstanceIDDataCallback; |
- InstanceIDStore(); |
- virtual ~InstanceIDStore(); |
- |
+ InstanceIDHandler(); |
+ virtual ~InstanceIDHandler(); |
+ |
+ // Token service. |
+ virtual void GetToken(const std::string& app_id, |
+ const std::string& authorized_entity, |
+ const std::string& scope, |
+ const std::map<std::string, std::string>& options, |
+ const GetTokenCallback& callback) = 0; |
+ virtual void DeleteToken(const std::string& app_id, |
+ const std::string& authorized_entity, |
+ const std::string& scope, |
+ const DeleteTokenCallback& callback) = 0; |
+ |
+ // Persistence support. |
virtual void AddInstanceIDData(const std::string& app_id, |
const std::string& instance_id_data) = 0; |
virtual void RemoveInstanceIDData(const std::string& app_id) = 0; |
@@ -39,7 +54,7 @@ class InstanceIDStore { |
const GetInstanceIDDataCallback& callback) = 0; |
private: |
- DISALLOW_COPY_AND_ASSIGN(InstanceIDStore); |
+ DISALLOW_COPY_AND_ASSIGN(InstanceIDHandler); |
}; |
// Bridge between GCM users in Chrome and the platform-specific implementation. |
@@ -166,8 +181,8 @@ class GCMDriver { |
// to send a heartbeat message. |
virtual void WakeFromSuspendForHeartbeat(bool wake) = 0; |
- // Supports saving the Instance ID data in the GCM store. |
- virtual InstanceIDStore* GetInstanceIDStore() = 0; |
+ // Supports InstanceID handling. |
+ virtual InstanceIDHandler* GetInstanceIDHandler() = 0; |
protected: |
// Ensures that the GCM service starts (if necessary conditions are met). |