| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CHROME_BROWSER_INVALIDATION_TICL_INVALIDATION_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_INVALIDATION_TICL_INVALIDATION_SERVICE_H_ |
| 6 #define CHROME_BROWSER_INVALIDATION_TICL_INVALIDATION_SERVICE_H_ | 6 #define CHROME_BROWSER_INVALIDATION_TICL_INVALIDATION_SERVICE_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/threading/non_thread_safe.h" | 9 #include "base/threading/non_thread_safe.h" |
| 10 #include "chrome/browser/invalidation/invalidation_frontend.h" | 10 #include "chrome/browser/invalidation/invalidation_frontend.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 namespace syncer { | 23 namespace syncer { |
| 24 class Invalidator; | 24 class Invalidator; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace invalidation { | 27 namespace invalidation { |
| 28 | 28 |
| 29 // This InvalidationService wraps the C++ Invalidation Client (TICL) library. | 29 // This InvalidationService wraps the C++ Invalidation Client (TICL) library. |
| 30 // It provides invalidations for desktop platforms (Win, Mac, Linux). | 30 // It provides invalidations for desktop platforms (Win, Mac, Linux). |
| 31 class TiclInvalidationService | 31 class TiclInvalidationService |
| 32 : public base::NonThreadSafe, | 32 : public base::NonThreadSafe, |
| 33 public ProfileKeyedService, | 33 public BrowserContextKeyedService, |
| 34 public InvalidationFrontend, | 34 public InvalidationFrontend, |
| 35 public content::NotificationObserver, | 35 public content::NotificationObserver, |
| 36 public syncer::InvalidationHandler { | 36 public syncer::InvalidationHandler { |
| 37 public: | 37 public: |
| 38 TiclInvalidationService(SigninManagerBase* signin, | 38 TiclInvalidationService(SigninManagerBase* signin, |
| 39 TokenService* token_service, | 39 TokenService* token_service, |
| 40 Profile* profile); | 40 Profile* profile); |
| 41 virtual ~TiclInvalidationService(); | 41 virtual ~TiclInvalidationService(); |
| 42 | 42 |
| 43 void Init(); | 43 void Init(); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 61 virtual void Observe(int type, | 61 virtual void Observe(int type, |
| 62 const content::NotificationSource& source, | 62 const content::NotificationSource& source, |
| 63 const content::NotificationDetails& details) OVERRIDE; | 63 const content::NotificationDetails& details) OVERRIDE; |
| 64 | 64 |
| 65 // syncer::InvalidationHandler implementation. | 65 // syncer::InvalidationHandler implementation. |
| 66 virtual void OnInvalidatorStateChange( | 66 virtual void OnInvalidatorStateChange( |
| 67 syncer::InvalidatorState state) OVERRIDE; | 67 syncer::InvalidatorState state) OVERRIDE; |
| 68 virtual void OnIncomingInvalidation( | 68 virtual void OnIncomingInvalidation( |
| 69 const syncer::ObjectIdInvalidationMap& invalidation_map) OVERRIDE; | 69 const syncer::ObjectIdInvalidationMap& invalidation_map) OVERRIDE; |
| 70 | 70 |
| 71 // Overrides ProfileKeyedService method. | 71 // Overrides BrowserContextKeyedService method. |
| 72 virtual void Shutdown() OVERRIDE; | 72 virtual void Shutdown() OVERRIDE; |
| 73 | 73 |
| 74 protected: | 74 protected: |
| 75 // Initializes with an injected invalidator. | 75 // Initializes with an injected invalidator. |
| 76 void InitForTest(syncer::Invalidator* invalidator); | 76 void InitForTest(syncer::Invalidator* invalidator); |
| 77 | 77 |
| 78 friend class TiclInvalidationServiceTestDelegate; | 78 friend class TiclInvalidationServiceTestDelegate; |
| 79 | 79 |
| 80 private: | 80 private: |
| 81 bool IsReadyToStart(); | 81 bool IsReadyToStart(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 95 scoped_ptr<syncer::Invalidator> invalidator_; | 95 scoped_ptr<syncer::Invalidator> invalidator_; |
| 96 | 96 |
| 97 content::NotificationRegistrar notification_registrar_; | 97 content::NotificationRegistrar notification_registrar_; |
| 98 | 98 |
| 99 DISALLOW_COPY_AND_ASSIGN(TiclInvalidationService); | 99 DISALLOW_COPY_AND_ASSIGN(TiclInvalidationService); |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 } | 102 } |
| 103 | 103 |
| 104 #endif // CHROME_BROWSER_INVALIDATION_TICL_INVALIDATION_SERVICE_H_ | 104 #endif // CHROME_BROWSER_INVALIDATION_TICL_INVALIDATION_SERVICE_H_ |
| OLD | NEW |