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) |