Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_ANDROID_INVALIDATION_SERVICE_H_ | |
|
tim (not reviewing)
2013/04/15 16:48:24
Just a heads up, we should put chrome-focused inva
tim (not reviewing)
2013/04/15 16:49:45
Er, to clarify, I didn't mean put it in sync/ I me
rlarocque
2013/04/17 01:02:32
SGTM. I wanted to avoid moving files around in th
| |
| 6 #define CHROME_BROWSER_ANDROID_INVALIDATION_SERVICE_H_ | |
| 7 | |
| 8 #include "base/threading/non_thread_safe.h" | |
| 9 #include "chrome/browser/profiles/profile_keyed_service.h" | |
| 10 #include "chrome/browser/sync/invalidation_frontend.h" | |
| 11 #include "content/public/browser/notification_observer.h" | |
| 12 #include "content/public/browser/notification_registrar.h" | |
| 13 #include "sync/notifier/invalidator_registrar.h" | |
| 14 | |
| 15 class Profile; | |
| 16 | |
| 17 class AndroidInvalidationService | |
| 18 : public base::NonThreadSafe, | |
| 19 public ProfileKeyedService, | |
| 20 public InvalidationFrontend, | |
| 21 public content::NotificationObserver{ | |
| 22 public: | |
| 23 AndroidInvalidationService(); | |
| 24 virtual ~AndroidInvalidationService(); | |
| 25 | |
| 26 void Init(Profile* profile); | |
| 27 | |
| 28 // InvalidationFrontend implementation. | |
| 29 // It is an error to have registered handlers when Shutdown() is called. | |
| 30 virtual void RegisterInvalidationHandler( | |
| 31 syncer::InvalidationHandler* handler) OVERRIDE; | |
| 32 virtual void UpdateRegisteredInvalidationIds( | |
| 33 syncer::InvalidationHandler* handler, | |
| 34 const syncer::ObjectIdSet& ids) OVERRIDE; | |
| 35 virtual void UnregisterInvalidationHandler( | |
| 36 syncer::InvalidationHandler* handler) OVERRIDE; | |
| 37 virtual void AcknowledgeInvalidation( | |
| 38 const invalidation::ObjectId& id, | |
| 39 const syncer::AckHandle& ack_handle) OVERRIDE; | |
| 40 virtual syncer::InvalidatorState GetInvalidatorState() const OVERRIDE; | |
| 41 virtual std::string GetInvalidatorClientId() const OVERRIDE; | |
| 42 | |
| 43 // content::NotificationObserver implementation. | |
| 44 virtual void Observe(int type, | |
| 45 const content::NotificationSource& source, | |
| 46 const content::NotificationDetails& details) OVERRIDE; | |
| 47 | |
| 48 private: | |
| 49 syncer::InvalidatorRegistrar invalidator_registrar_; | |
| 50 content::NotificationRegistrar registrar_; | |
| 51 }; | |
| 52 | |
| 53 #endif // CHROME_BROWSER_ANDROID_INVALIDATION_SERVICE_H_ | |
| OLD | NEW |