OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_P2P_SYNC_REFRESHER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_P2P_SYNC_REFRESHER_H_ |
6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_P2P_SYNC_REFRESHER_H_ | 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_P2P_SYNC_REFRESHER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "components/sync/driver/sync_service_observer.h" | 9 #include "components/sync/driver/sync_service_observer.h" |
10 | 10 |
11 class Profile; | 11 class Profile; |
12 | 12 |
13 namespace browser_sync { | 13 namespace browser_sync { |
14 class ProfileSyncService; | 14 class ProfileSyncService; |
15 } // namespace browser_sync | 15 } // namespace browser_sync |
16 | 16 |
17 // This class observes ProfileSyncService events and emits refresh notifications | 17 // This class observes ProfileSyncService events and emits refresh notifications |
18 // to other test profiles for any committed changes it observes. | 18 // to other test profiles for any committed changes it observes. |
19 // | 19 // |
20 // It register and unregisters in its constructor and destructor. This is | 20 // It register and unregisters in its constructor and destructor. This is |
21 // intended to make it easy to manage with a scoped_ptr. | 21 // intended to make it easy to manage with a scoped_ptr. |
22 class P2PSyncRefresher : public syncer::SyncServiceObserver { | 22 class P2PSyncRefresher : public syncer::SyncServiceObserver { |
23 public: | 23 public: |
24 P2PSyncRefresher(Profile* profile, | 24 P2PSyncRefresher(Profile* profile, |
25 browser_sync::ProfileSyncService* sync_service); | 25 browser_sync::ProfileSyncService* sync_service); |
26 ~P2PSyncRefresher() override; | 26 ~P2PSyncRefresher() override; |
27 | 27 |
28 // Implementation of syncer::SyncServiceObserver | 28 // Implementation of syncer::SyncServiceObserver |
29 void OnStateChanged() override; | 29 void OnSyncCycleCompleted(syncer::SyncService* sync) override; |
30 void OnSyncCycleCompleted() override; | |
31 | 30 |
32 private: | 31 private: |
33 Profile* const profile_; // weak | 32 Profile* const profile_; // weak |
34 browser_sync::ProfileSyncService* sync_service_; // weak | 33 browser_sync::ProfileSyncService* sync_service_; // weak |
35 | 34 |
36 DISALLOW_COPY_AND_ASSIGN(P2PSyncRefresher); | 35 DISALLOW_COPY_AND_ASSIGN(P2PSyncRefresher); |
37 }; | 36 }; |
38 | 37 |
39 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_P2P_SYNC_REFRESHER_H_ | 38 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_P2P_SYNC_REFRESHER_H_ |
OLD | NEW |