| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_INVALIDATION_TICL_INVALIDATION_SERVICE_H_ | 5 #ifndef COMPONENTS_INVALIDATION_TICL_INVALIDATION_SERVICE_H_ |
| 6 #define COMPONENTS_INVALIDATION_TICL_INVALIDATION_SERVICE_H_ | 6 #define COMPONENTS_INVALIDATION_TICL_INVALIDATION_SERVICE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 // this line. | 58 // this line. |
| 59 NETWORK_CHANNELS_COUNT = 2 | 59 NETWORK_CHANNELS_COUNT = 2 |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 TiclInvalidationService( | 62 TiclInvalidationService( |
| 63 const std::string& user_agent, | 63 const std::string& user_agent, |
| 64 scoped_ptr<IdentityProvider> identity_provider, | 64 scoped_ptr<IdentityProvider> identity_provider, |
| 65 scoped_ptr<TiclSettingsProvider> settings_provider, | 65 scoped_ptr<TiclSettingsProvider> settings_provider, |
| 66 gcm::GCMDriver* gcm_driver, | 66 gcm::GCMDriver* gcm_driver, |
| 67 const scoped_refptr<net::URLRequestContextGetter>& request_context); | 67 const scoped_refptr<net::URLRequestContextGetter>& request_context); |
| 68 virtual ~TiclInvalidationService(); | 68 ~TiclInvalidationService() override; |
| 69 | 69 |
| 70 void Init( | 70 void Init( |
| 71 scoped_ptr<syncer::InvalidationStateTracker> invalidation_state_tracker); | 71 scoped_ptr<syncer::InvalidationStateTracker> invalidation_state_tracker); |
| 72 | 72 |
| 73 // InvalidationService implementation. | 73 // InvalidationService implementation. |
| 74 // It is an error to have registered handlers when the service is destroyed. | 74 // It is an error to have registered handlers when the service is destroyed. |
| 75 virtual void RegisterInvalidationHandler( | 75 void RegisterInvalidationHandler( |
| 76 syncer::InvalidationHandler* handler) override; | 76 syncer::InvalidationHandler* handler) override; |
| 77 virtual void UpdateRegisteredInvalidationIds( | 77 void UpdateRegisteredInvalidationIds(syncer::InvalidationHandler* handler, |
| 78 syncer::InvalidationHandler* handler, | 78 const syncer::ObjectIdSet& ids) override; |
| 79 const syncer::ObjectIdSet& ids) override; | 79 void UnregisterInvalidationHandler( |
| 80 virtual void UnregisterInvalidationHandler( | |
| 81 syncer::InvalidationHandler* handler) override; | 80 syncer::InvalidationHandler* handler) override; |
| 82 virtual syncer::InvalidatorState GetInvalidatorState() const override; | 81 syncer::InvalidatorState GetInvalidatorState() const override; |
| 83 virtual std::string GetInvalidatorClientId() const override; | 82 std::string GetInvalidatorClientId() const override; |
| 84 virtual InvalidationLogger* GetInvalidationLogger() override; | 83 InvalidationLogger* GetInvalidationLogger() override; |
| 85 virtual void RequestDetailedStatus( | 84 void RequestDetailedStatus( |
| 86 base::Callback<void(const base::DictionaryValue&)> caller) const override; | 85 base::Callback<void(const base::DictionaryValue&)> caller) const override; |
| 87 virtual IdentityProvider* GetIdentityProvider() override; | 86 IdentityProvider* GetIdentityProvider() override; |
| 88 | 87 |
| 89 void RequestAccessToken(); | 88 void RequestAccessToken(); |
| 90 | 89 |
| 91 // OAuth2TokenService::Consumer implementation | 90 // OAuth2TokenService::Consumer implementation |
| 92 virtual void OnGetTokenSuccess( | 91 void OnGetTokenSuccess(const OAuth2TokenService::Request* request, |
| 93 const OAuth2TokenService::Request* request, | 92 const std::string& access_token, |
| 94 const std::string& access_token, | 93 const base::Time& expiration_time) override; |
| 95 const base::Time& expiration_time) override; | 94 void OnGetTokenFailure(const OAuth2TokenService::Request* request, |
| 96 virtual void OnGetTokenFailure( | 95 const GoogleServiceAuthError& error) override; |
| 97 const OAuth2TokenService::Request* request, | |
| 98 const GoogleServiceAuthError& error) override; | |
| 99 | 96 |
| 100 // OAuth2TokenService::Observer implementation | 97 // OAuth2TokenService::Observer implementation |
| 101 virtual void OnRefreshTokenAvailable(const std::string& account_id) override; | 98 void OnRefreshTokenAvailable(const std::string& account_id) override; |
| 102 virtual void OnRefreshTokenRevoked(const std::string& account_id) override; | 99 void OnRefreshTokenRevoked(const std::string& account_id) override; |
| 103 | 100 |
| 104 // IdentityProvider::Observer implementation. | 101 // IdentityProvider::Observer implementation. |
| 105 virtual void OnActiveAccountLogout() override; | 102 void OnActiveAccountLogout() override; |
| 106 | 103 |
| 107 // TiclSettingsProvider::Observer implementation. | 104 // TiclSettingsProvider::Observer implementation. |
| 108 virtual void OnUseGCMChannelChanged() override; | 105 void OnUseGCMChannelChanged() override; |
| 109 | 106 |
| 110 // syncer::InvalidationHandler implementation. | 107 // syncer::InvalidationHandler implementation. |
| 111 virtual void OnInvalidatorStateChange( | 108 void OnInvalidatorStateChange(syncer::InvalidatorState state) override; |
| 112 syncer::InvalidatorState state) override; | 109 void OnIncomingInvalidation( |
| 113 virtual void OnIncomingInvalidation( | |
| 114 const syncer::ObjectIdInvalidationMap& invalidation_map) override; | 110 const syncer::ObjectIdInvalidationMap& invalidation_map) override; |
| 115 virtual std::string GetOwnerName() const override; | 111 std::string GetOwnerName() const override; |
| 116 | 112 |
| 117 protected: | 113 protected: |
| 118 // Initializes with an injected invalidator. | 114 // Initializes with an injected invalidator. |
| 119 void InitForTest( | 115 void InitForTest( |
| 120 scoped_ptr<syncer::InvalidationStateTracker> invalidation_state_tracker, | 116 scoped_ptr<syncer::InvalidationStateTracker> invalidation_state_tracker, |
| 121 syncer::Invalidator* invalidator); | 117 syncer::Invalidator* invalidator); |
| 122 | 118 |
| 123 private: | 119 private: |
| 124 friend class TiclInvalidationServiceTestDelegate; | 120 friend class TiclInvalidationServiceTestDelegate; |
| 125 friend class TiclProfileSettingsProviderTest; | 121 friend class TiclProfileSettingsProviderTest; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 // Keep a copy of the important parameters used in network channel creation | 159 // Keep a copy of the important parameters used in network channel creation |
| 164 // for debugging. | 160 // for debugging. |
| 165 base::DictionaryValue network_channel_options_; | 161 base::DictionaryValue network_channel_options_; |
| 166 | 162 |
| 167 DISALLOW_COPY_AND_ASSIGN(TiclInvalidationService); | 163 DISALLOW_COPY_AND_ASSIGN(TiclInvalidationService); |
| 168 }; | 164 }; |
| 169 | 165 |
| 170 } // namespace invalidation | 166 } // namespace invalidation |
| 171 | 167 |
| 172 #endif // COMPONENTS_INVALIDATION_TICL_INVALIDATION_SERVICE_H_ | 168 #endif // COMPONENTS_INVALIDATION_TICL_INVALIDATION_SERVICE_H_ |
| OLD | NEW |