Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Unified Diff: chrome/browser/android_invalidation_service.h

Issue 13197004: Draft: InvalidationService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Passes tests Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698