OLD | NEW |
(Empty) | |
| 1 // Copyright 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_SYNC_TEST_INTEGRATION_P2P_INVALIDATION_FORWARDER_H_ |
| 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_P2P_INVALIDATION_FORWARDER_H_ |
| 7 |
| 8 #include "base/compiler_specific.h" |
| 9 #include "chrome/browser/sync/profile_sync_service_observer.h" |
| 10 |
| 11 class ProfileSyncService; |
| 12 |
| 13 namespace invalidation { |
| 14 class P2PInvalidationService; |
| 15 }; |
| 16 |
| 17 // This class links the ProfileSyncService to a P2PInvalidationService. |
| 18 // |
| 19 // It will observe ProfileSyncService events and emit invalidation events for |
| 20 // any committed changes in observes. |
| 21 // |
| 22 // It register and unregisters in its constructor and destructor. This is |
| 23 // intended to make it easy to manage with a scoped_ptr. |
| 24 class P2PInvalidationForwarder : public ProfileSyncServiceObserver { |
| 25 public: |
| 26 P2PInvalidationForwarder( |
| 27 ProfileSyncService* sync_service, |
| 28 invalidation::P2PInvalidationService* invalidation_service); |
| 29 virtual ~P2PInvalidationForwarder(); |
| 30 |
| 31 // Implementation of ProfileSyncServiceObserver |
| 32 virtual void OnStateChanged() OVERRIDE; |
| 33 virtual void OnSyncCycleCompleted() OVERRIDE; |
| 34 |
| 35 private: |
| 36 ProfileSyncService* sync_service_; |
| 37 invalidation::P2PInvalidationService* invalidation_service_; |
| 38 }; |
| 39 |
| 40 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_P2P_INVALIDATION_FORWARDER_H_ |
OLD | NEW |