| Index: chrome/browser/services/gcm/gcm_profile_service.h
|
| diff --git a/chrome/browser/services/gcm/gcm_profile_service.h b/chrome/browser/services/gcm/gcm_profile_service.h
|
| index 633a6e8c7356953d3f57ef91c964a75b60e4cec7..3d982077f487dbc67a7a854cd75ea894e0b6afa8 100644
|
| --- a/chrome/browser/services/gcm/gcm_profile_service.h
|
| +++ b/chrome/browser/services/gcm/gcm_profile_service.h
|
| @@ -46,6 +46,8 @@ class GCMProfileService : public BrowserContextKeyedService,
|
| GCMClient::Result result)> RegisterCallback;
|
| typedef base::Callback<void(const std::string& message_id,
|
| GCMClient::Result result)> SendCallback;
|
| + typedef base::Callback<void(const GCMClient::GCMStatistics& stats)>
|
| + RequestGCMStatisticsCallback;
|
|
|
| // For testing purpose.
|
| class TestingDelegate {
|
| @@ -92,6 +94,19 @@ class GCMProfileService : public BrowserContextKeyedService,
|
| testing_delegate_ = testing_delegate;
|
| }
|
|
|
| + // Returns true if the profile is signed in.
|
| + bool IsSignedIn() const;
|
| +
|
| + // Returns true if the gcm client instance has been created.
|
| + bool IsGCMClientCreated() const;
|
| +
|
| + // Returns true if the gcm client is ready.
|
| + bool IsGCMClientReady() const;
|
| +
|
| + // Get GCM client internal states and statistics. If it has not been created
|
| + // then stats won't be modified.
|
| + void RequestGCMStatistics(RequestGCMStatisticsCallback callback);
|
| +
|
| protected:
|
| // Flag that could be set by the testing code to enable GCM. Otherwise,
|
| // tests from official build will fail.
|
| @@ -173,6 +188,7 @@ class GCMProfileService : public BrowserContextKeyedService,
|
| scoped_ptr<base::Value> value);
|
| bool ParsePersistedRegistrationInfo(scoped_ptr<base::Value> value,
|
| RegistrationInfo* registration_info);
|
| + void RequestGCMStatisticsFinished(GCMClient::GCMStatistics stats);
|
|
|
| // Returns the key used to identify the registration info saved into the
|
| // app's state store. Used for testing purpose.
|
| @@ -203,6 +219,9 @@ class GCMProfileService : public BrowserContextKeyedService,
|
| // Callback map (from <app_id, message_id> to callback) for Send.
|
| std::map<std::pair<std::string, std::string>, SendCallback> send_callbacks_;
|
|
|
| + // Callback for RequestGCMStatistics.
|
| + RequestGCMStatisticsCallback request_gcm_statistics_callback_;
|
| +
|
| // Map from app_id to registration info (sender ids & registration ID).
|
| typedef std::map<std::string, RegistrationInfo> RegistrationInfoMap;
|
| RegistrationInfoMap registration_info_map_;
|
|
|