Chromium Code Reviews| Index: chrome/browser/android_invalidation_service.h |
| diff --git a/chrome/browser/android_invalidation_service.h b/chrome/browser/android_invalidation_service.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..29a46d4d7aba536cb38b0ec67a07fa069ae8bf02 |
| --- /dev/null |
| +++ b/chrome/browser/android_invalidation_service.h |
| @@ -0,0 +1,53 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#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
|
| +#define CHROME_BROWSER_ANDROID_INVALIDATION_SERVICE_H_ |
| + |
| +#include "base/threading/non_thread_safe.h" |
| +#include "chrome/browser/profiles/profile_keyed_service.h" |
| +#include "chrome/browser/sync/invalidation_frontend.h" |
| +#include "content/public/browser/notification_observer.h" |
| +#include "content/public/browser/notification_registrar.h" |
| +#include "sync/notifier/invalidator_registrar.h" |
| + |
| +class Profile; |
| + |
| +class AndroidInvalidationService |
| + : public base::NonThreadSafe, |
| + public ProfileKeyedService, |
| + public InvalidationFrontend, |
| + public content::NotificationObserver{ |
| + public: |
| + AndroidInvalidationService(); |
| + virtual ~AndroidInvalidationService(); |
| + |
| + void Init(Profile* profile); |
| + |
| + // InvalidationFrontend implementation. |
| + // It is an error to have registered handlers when Shutdown() is called. |
| + virtual void RegisterInvalidationHandler( |
| + syncer::InvalidationHandler* handler) OVERRIDE; |
| + virtual void UpdateRegisteredInvalidationIds( |
| + syncer::InvalidationHandler* handler, |
| + const syncer::ObjectIdSet& ids) OVERRIDE; |
| + virtual void UnregisterInvalidationHandler( |
| + syncer::InvalidationHandler* handler) OVERRIDE; |
| + virtual void AcknowledgeInvalidation( |
| + const invalidation::ObjectId& id, |
| + const syncer::AckHandle& ack_handle) OVERRIDE; |
| + virtual syncer::InvalidatorState GetInvalidatorState() const OVERRIDE; |
| + virtual std::string GetInvalidatorClientId() const OVERRIDE; |
| + |
| + // content::NotificationObserver implementation. |
| + virtual void Observe(int type, |
| + const content::NotificationSource& source, |
| + const content::NotificationDetails& details) OVERRIDE; |
| + |
| + private: |
| + syncer::InvalidatorRegistrar invalidator_registrar_; |
| + content::NotificationRegistrar registrar_; |
| +}; |
| + |
| +#endif // CHROME_BROWSER_ANDROID_INVALIDATION_SERVICE_H_ |