| 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 class ProfileSyncService; | 12 class ProfileSyncService; |
| 13 | 13 |
| 14 // This class observes ProfileSyncService events and emits refresh notifications | 14 // This class observes ProfileSyncService events and emits refresh notifications |
| 15 // to other test profiles for any committed changes it observes. | 15 // to other test profiles for any committed changes it observes. |
| 16 // | 16 // |
| 17 // It register and unregisters in its constructor and destructor. This is | 17 // It register and unregisters in its constructor and destructor. This is |
| 18 // intended to make it easy to manage with a scoped_ptr. | 18 // intended to make it easy to manage with a scoped_ptr. |
| 19 class P2PSyncRefresher : public sync_driver::SyncServiceObserver { | 19 class P2PSyncRefresher : public sync_driver::SyncServiceObserver { |
| 20 public: | 20 public: |
| 21 P2PSyncRefresher(Profile* profile, ProfileSyncService* sync_service); | 21 P2PSyncRefresher(Profile* profile, ProfileSyncService* sync_service); |
| 22 ~P2PSyncRefresher() override; | 22 ~P2PSyncRefresher() override; |
| 23 | 23 |
| 24 // Implementation of sync_driver::SyncServiceObserver | 24 // Implementation of sync_driver::SyncServiceObserver |
| 25 void OnStateChanged() override; | 25 void OnStateChanged() override; |
| 26 void OnSyncCycleCompleted() override; | 26 void OnSyncCycleCompleted() override; |
| 27 | 27 |
| 28 private: | 28 private: |
| 29 Profile* const profile_; // weak | 29 Profile* const profile_; // weak |
| 30 ProfileSyncService* sync_service_; // weak | 30 ProfileSyncService* sync_service_; // weak |
| 31 | 31 |
| 32 DISALLOW_COPY_AND_ASSIGN(P2PSyncRefresher); | 32 DISALLOW_COPY_AND_ASSIGN(P2PSyncRefresher); |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_P2P_SYNC_REFRESHER_H_ | 35 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_P2P_SYNC_REFRESHER_H_ |
| OLD | NEW |