Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(787)

Unified Diff: chrome/browser/services/gcm/gcm_profile_service.h

Issue 165993005: [GCM] Make sure GCM checkout logic is invoked when the profile is signed out (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address feedback Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..be0dbc1bb26a9048368a8432b7706a637204e2e8 100644
--- a/chrome/browser/services/gcm/gcm_profile_service.h
+++ b/chrome/browser/services/gcm/gcm_profile_service.h
@@ -88,6 +88,8 @@ class GCMProfileService : public BrowserContextKeyedService,
SendCallback callback);
// For testing purpose.
+ GCMClient* GetGCMClientForTesting() const;
+
void set_testing_delegate(TestingDelegate* testing_delegate) {
testing_delegate_ = testing_delegate;
}
@@ -117,9 +119,12 @@ class GCMProfileService : public BrowserContextKeyedService,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
- // Checks in with GCM by creating and initializing GCMClient when the profile
- // has been signed in.
- void CheckIn(const std::string& username);
+ // Returns true if GCM is enabled for the rollout channel.
Nicolas Zea 2014/02/21 18:43:33 nit: mention that this controls whether the GCMPS
jianli 2014/02/21 20:24:06 Done.
+ bool IsGCMChannelEnabled() const;
+
+ // Ensures that the GCMClient is initialized and the GCM check-in is done when
+ // the profile was signed in.
+ void EnsureCheckedIn();
// Checks out of GCM when the profile has been signed out. This will erase
// all the cached and persisted data.
@@ -155,7 +160,7 @@ class GCMProfileService : public BrowserContextKeyedService,
void MessageSendError(const std::string& app_id,
const std::string& message_id,
GCMClient::Result result);
- void FinishInitializationOnUI(bool ready);
+ void FinishInitializationOnUI();
void GCMClientReady();
// Returns the event router to fire the event for the given app.
@@ -181,9 +186,6 @@ class GCMProfileService : public BrowserContextKeyedService,
// The profile which owns this object.
Profile* profile_;
- // Used to creat the GCMClient instance.
- scoped_ptr<GCMClientFactory> gcm_client_factory_;
-
// Flag to indicate if GCMClient is ready.
bool gcm_client_ready_;

Powered by Google App Engine
This is Rietveld 408576698