Chromium Code Reviews| Index: chrome/browser/extensions/token_cache/token_cache_service.cc |
| diff --git a/chrome/browser/extensions/token_cache/token_cache_service.cc b/chrome/browser/extensions/token_cache/token_cache_service.cc |
| index 9d5aabd3b403aa91c6d5ba9060fa497cf85a91ca..166a17873b7ebf720b34da2a76df81be97d30e4e 100644 |
| --- a/chrome/browser/extensions/token_cache/token_cache_service.cc |
| +++ b/chrome/browser/extensions/token_cache/token_cache_service.cc |
| @@ -2,11 +2,10 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#include "chrome/browser/extensions/token_cache/token_cache_service.h" |
| - |
| #include "base/logging.h" |
| -#include "chrome/browser/chrome_notification_types.h" |
| -#include "content/public/browser/notification_source.h" |
| +#include "chrome/browser/extensions/token_cache/token_cache_service.h" |
| +#include "chrome/browser/signin/signin_manager.h" |
| +#include "chrome/browser/signin/signin_manager_factory.h" |
| using base::Time; |
| using base::TimeDelta; |
| @@ -14,12 +13,12 @@ using base::TimeDelta; |
| namespace extensions { |
| TokenCacheService::TokenCacheService(Profile* profile) : profile_(profile) { |
| - registrar_.Add(this, |
| - chrome::NOTIFICATION_GOOGLE_SIGNED_OUT, |
| - content::Source<Profile>(profile_)); |
| + SigninManagerFactory::GetForProfile(profile)->AddObserver(this); |
| } |
| TokenCacheService::~TokenCacheService() { |
| + SigninManagerFactory::GetForProfile(const_cast<Profile*>(profile_)) |
|
Yoyo Zhou
2014/02/18 17:45:54
This should be in TokenCacheService::Shutdown.
Al
blundell
2014/02/18 19:53:42
Great catches, thanks. Done.
On 2014/02/18 17:45:
|
| + ->RemoveObserver(this); |
| } |
| void TokenCacheService::StoreToken(const std::string& token_name, |
| @@ -67,11 +66,7 @@ std::string TokenCacheService::RetrieveToken(const std::string& token_name) { |
| return std::string(); |
| } |
| -// Inherited from NotificationObserver. |
| -void TokenCacheService::Observe(int type, |
| - const content::NotificationSource& source, |
| - const content::NotificationDetails& details) { |
| - DCHECK(chrome::NOTIFICATION_GOOGLE_SIGNED_OUT == type); |
| +void TokenCacheService::GoogleSignedOut(const std::string& username) { |
| token_cache_.clear(); |
| } |