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

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

Issue 196783002: Export a private webstore API to call into the new inline sign-in flow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add API tests Created 6 years, 9 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.cc
diff --git a/chrome/browser/services/gcm/gcm_profile_service.cc b/chrome/browser/services/gcm/gcm_profile_service.cc
index 1f4d884a7ea5817bf052c8cacbd64897cc6758c2..0f35fcac7778fa59157b2ced359f057d1ea25650 100644
--- a/chrome/browser/services/gcm/gcm_profile_service.cc
+++ b/chrome/browser/services/gcm/gcm_profile_service.cc
@@ -20,7 +20,6 @@
#include "chrome/browser/services/gcm/gcm_client_factory.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "chrome/browser/signin/signin_manager.h"
-#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_version_info.h"
@@ -449,6 +448,7 @@ void GCMProfileService::Initialize(
content::Source<Profile>(profile_));
SigninManagerFactory::GetForProfile(profile_)->AddObserver(this);
+ SigninManagerFactory::GetInstance()->AddObserver(this);
// Get the list of available accounts.
std::vector<std::string> account_ids;
@@ -506,6 +506,7 @@ void GCMProfileService::Shutdown() {
}
app_handlers_.clear();
+ SigninManagerFactory::GetInstance()->RemoveObserver(this);
SigninManagerFactory::GetForProfile(profile_)->RemoveObserver(this);
}
@@ -722,6 +723,14 @@ void GCMProfileService::GoogleSignedOut(const std::string& username) {
CheckOut();
}
+void GCMProfileService::SigninManagerCreated(SigninManagerBase* manager) {
+ manager->AddObserver(this);
+}
+
+void GCMProfileService::SigninManagerShutdown(SigninManagerBase* manager) {
+ manager->RemoveObserver(this);
+}
+
void GCMProfileService::EnsureLoaded() {
SigninManagerBase* manager = SigninManagerFactory::GetForProfile(profile_);
if (!manager)

Powered by Google App Engine
This is Rietveld 408576698