| Index: chrome/browser/invalidation/ticl_invalidation_service.h
|
| diff --git a/chrome/browser/invalidation/ticl_invalidation_service.h b/chrome/browser/invalidation/ticl_invalidation_service.h
|
| index 6b99a90212d362d9601fa36461675ed1cc30c305..7cd562e676330f36bc04f66225eb4f06f8665a2b 100644
|
| --- a/chrome/browser/invalidation/ticl_invalidation_service.h
|
| +++ b/chrome/browser/invalidation/ticl_invalidation_service.h
|
| @@ -7,24 +7,23 @@
|
|
|
| #include <string>
|
|
|
| +#include "base/compiler_specific.h"
|
| +#include "base/macros.h"
|
| #include "base/memory/ref_counted.h"
|
| #include "base/memory/scoped_ptr.h"
|
| -#include "base/prefs/pref_change_registrar.h"
|
| #include "base/threading/non_thread_safe.h"
|
| #include "base/timer/timer.h"
|
| #include "base/values.h"
|
| #include "chrome/browser/invalidation/invalidation_logger.h"
|
| #include "chrome/browser/invalidation/invalidation_service.h"
|
| +#include "chrome/browser/invalidation/ticl_invalidation_service_settings_provider.h"
|
| #include "components/keyed_service/core/keyed_service.h"
|
| -#include "components/signin/core/browser/profile_oauth2_token_service.h"
|
| #include "google_apis/gaia/identity_provider.h"
|
| #include "google_apis/gaia/oauth2_token_service.h"
|
| #include "net/base/backoff_entry.h"
|
| #include "sync/notifier/invalidation_handler.h"
|
| #include "sync/notifier/invalidator_registrar.h"
|
|
|
| -class Profile;
|
| -
|
| namespace gcm {
|
| class GCMService;
|
| }
|
| @@ -43,12 +42,14 @@ class GCMInvalidationBridge;
|
|
|
| // This InvalidationService wraps the C++ Invalidation Client (TICL) library.
|
| // It provides invalidations for desktop platforms (Win, Mac, Linux).
|
| -class TiclInvalidationService : public base::NonThreadSafe,
|
| - public InvalidationService,
|
| - public OAuth2TokenService::Consumer,
|
| - public OAuth2TokenService::Observer,
|
| - public IdentityProvider::Observer,
|
| - public syncer::InvalidationHandler {
|
| +class TiclInvalidationService
|
| + : public base::NonThreadSafe,
|
| + public InvalidationService,
|
| + public OAuth2TokenService::Consumer,
|
| + public OAuth2TokenService::Observer,
|
| + public IdentityProvider::Observer,
|
| + public TiclInvalidationServiceSettingsProvider::Observer,
|
| + public syncer::InvalidationHandler {
|
| public:
|
| enum InvalidationNetworkChannel {
|
| PUSH_CLIENT_CHANNEL = 0,
|
| @@ -61,9 +62,9 @@ class TiclInvalidationService : public base::NonThreadSafe,
|
|
|
| TiclInvalidationService(
|
| scoped_ptr<IdentityProvider> identity_provider,
|
| + scoped_ptr<TiclInvalidationServiceSettingsProvider> settings_provider,
|
| gcm::GCMService* gcm_service,
|
| - const scoped_refptr<net::URLRequestContextGetter>& request_context,
|
| - Profile* profile);
|
| + const scoped_refptr<net::URLRequestContextGetter>& request_context);
|
| virtual ~TiclInvalidationService();
|
|
|
| void Init(
|
| @@ -103,6 +104,9 @@ class TiclInvalidationService : public base::NonThreadSafe,
|
| // IdentityProvider::Observer implementation.
|
| virtual void OnActiveAccountLogout() OVERRIDE;
|
|
|
| + // TiclInvalidationServiceSettingsProvider::Observer implementation.
|
| + virtual void OnUseGCMChannelChanged() OVERRIDE;
|
| +
|
| // syncer::InvalidationHandler implementation.
|
| virtual void OnInvalidatorStateChange(
|
| syncer::InvalidatorState state) OVERRIDE;
|
| @@ -119,10 +123,10 @@ class TiclInvalidationService : public base::NonThreadSafe,
|
| scoped_ptr<syncer::InvalidationStateTracker> invalidation_state_tracker,
|
| syncer::Invalidator* invalidator);
|
|
|
| + private:
|
| friend class TiclInvalidationServiceTestDelegate;
|
| - friend class TiclInvalidationServiceChannelTest;
|
| + friend class TiclInvalidationServiceProfileSettingsProviderTest;
|
|
|
| - private:
|
| bool IsReadyToStart();
|
| bool IsStarted() const;
|
|
|
| @@ -131,8 +135,8 @@ class TiclInvalidationService : public base::NonThreadSafe,
|
| void UpdateInvalidatorCredentials();
|
| void StopInvalidator();
|
|
|
| - Profile *const profile_;
|
| scoped_ptr<IdentityProvider> identity_provider_;
|
| + scoped_ptr<TiclInvalidationServiceSettingsProvider> settings_provider_;
|
|
|
| scoped_ptr<syncer::InvalidatorRegistrar> invalidator_registrar_;
|
| scoped_ptr<syncer::InvalidationStateTracker> invalidation_state_tracker_;
|
| @@ -148,7 +152,6 @@ class TiclInvalidationService : public base::NonThreadSafe,
|
| base::OneShotTimer<TiclInvalidationService> request_access_token_retry_timer_;
|
| net::BackoffEntry request_access_token_backoff_;
|
|
|
| - PrefChangeRegistrar pref_change_registrar_;
|
| InvalidationNetworkChannel network_channel_type_;
|
| gcm::GCMService* gcm_service_;
|
| scoped_ptr<GCMInvalidationBridge> gcm_invalidation_bridge_;
|
|
|