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 70b61122e529bee3fcb6f54257705cdc52739d74..1be7b03486e5e90a6471b80d91fdc692d7b63c50 100644 |
--- a/chrome/browser/services/gcm/gcm_profile_service.h |
+++ b/chrome/browser/services/gcm/gcm_profile_service.h |
@@ -15,6 +15,10 @@ |
#include "components/gcm_driver/gcm_driver.h" |
#include "components/keyed_service/core/keyed_service.h" |
+#if !defined(OS_ANDROID) |
+#include "google_apis/gaia/identity_provider.h" |
+#endif |
+ |
class Profile; |
namespace user_prefs { |
@@ -27,7 +31,12 @@ class GCMClientFactory; |
class GCMDriver; |
// Providing GCM service, via GCMDriver, to a profile. |
+#if defined(OS_ANDROID) |
class GCMProfileService : public KeyedService { |
+#else |
+class GCMProfileService : public KeyedService, |
+ public IdentityProvider::Observer { |
+#endif |
public: |
// Returns whether GCM is enabled for |profile|. |
static bool IsGCMEnabled(Profile* profile); |
@@ -53,6 +62,15 @@ class GCMProfileService : public KeyedService { |
// KeyedService: |
virtual void Shutdown() OVERRIDE; |
+ // IdentityProvider::Observer: |
bartfab (slow)
2014/06/13 11:27:21
Nit: Move the comment inside the #if. It is only a
jianli
2014/06/13 18:04:48
Done.
|
+#if !defined(OS_ANDROID) |
+ virtual void OnActiveAccountLogin() OVERRIDE; |
+ virtual void OnActiveAccountLogout() OVERRIDE; |
+#endif |
+ |
+ // Returns the user name if the profile is signed in. Empty string otherwise. |
bartfab (slow)
2014/06/13 11:27:21
nit: s/. Emtpy/ or an empty/
jianli
2014/06/13 18:04:48
Done.
|
+ std::string SignedInUserName() const; |
+ |
// For testing purpose. |
void SetDriverForTesting(GCMDriver* driver); |
@@ -68,6 +86,14 @@ class GCMProfileService : public KeyedService { |
scoped_ptr<GCMDriver> driver_; |
+#if !defined(OS_ANDROID) |
+ scoped_ptr<IdentityProvider> identity_provider_; |
+ |
+ // The account ID that this service is responsible for. Empty when the service |
+ // is not running. |
+ std::string account_id_; |
+#endif |
+ |
DISALLOW_COPY_AND_ASSIGN(GCMProfileService); |
}; |