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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698