OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 IOS_CHROME_BROWSER_SIGNIN_DESKTOP_PROMOTION_SYNC_OBSERVER_H_ | 5 #ifndef IOS_CHROME_BROWSER_SIGNIN_DESKTOP_PROMOTION_SYNC_OBSERVER_H_ |
6 #define IOS_CHROME_BROWSER_SIGNIN_DESKTOP_PROMOTION_SYNC_OBSERVER_H_ | 6 #define IOS_CHROME_BROWSER_SIGNIN_DESKTOP_PROMOTION_SYNC_OBSERVER_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 namespace browser_sync { | 11 namespace browser_sync { |
12 class ProfileSyncService; | 12 class ProfileSyncService; |
13 } | 13 } |
14 | 14 |
15 class PrefService; | 15 class PrefService; |
16 | 16 |
17 // This class will implement ProfileSyncServiceObserver and will attach it self | 17 // This class will implement ProfileSyncServiceObserver and will attach it self |
18 // to the sync service to observe the sync state change. | 18 // to the sync service to observe the sync state change. |
19 // Once the sync state is changed and priority prefs are synced, the observer | 19 // Once the sync state is changed and priority prefs are synced, the observer |
20 // will check the desktop promotion prefs, and if eligilble it will log desktop | 20 // will check the desktop promotion prefs, and if eligilble it will log desktop |
21 // promotion metrics to uma and mark the promotion cycle as completed in a perf. | 21 // promotion metrics to uma and mark the promotion cycle as completed in a perf. |
22 class DesktopPromotionSyncObserver : public syncer::SyncServiceObserver { | 22 class DesktopPromotionSyncObserver : public syncer::SyncServiceObserver { |
23 public: | 23 public: |
24 DesktopPromotionSyncObserver(PrefService* pref_service, | 24 DesktopPromotionSyncObserver(PrefService* pref_service, |
25 browser_sync::ProfileSyncService* sync_service); | 25 browser_sync::ProfileSyncService* sync_service); |
26 | 26 |
27 ~DesktopPromotionSyncObserver() override; | 27 ~DesktopPromotionSyncObserver() override; |
28 | 28 |
29 // ProfileSyncServiceObserver implementation. | 29 // ProfileSyncServiceObserver implementation. |
30 void OnStateChanged() override; | 30 void OnStateChanged(syncer::SyncService* sync) override; |
31 | 31 |
32 private: | 32 private: |
33 PrefService* pref_service_; | 33 PrefService* pref_service_; |
34 browser_sync::ProfileSyncService* sync_service_; | 34 browser_sync::ProfileSyncService* sync_service_; |
35 bool desktop_metrics_logger_initiated_; | 35 bool desktop_metrics_logger_initiated_; |
36 | 36 |
37 DISALLOW_COPY_AND_ASSIGN(DesktopPromotionSyncObserver); | 37 DISALLOW_COPY_AND_ASSIGN(DesktopPromotionSyncObserver); |
38 }; | 38 }; |
39 | 39 |
40 #endif // IOS_CHROME_BROWSER_SIGNIN_DESKTOP_PROMOTION_SYNC_OBSERVER_H_ | 40 #endif // IOS_CHROME_BROWSER_SIGNIN_DESKTOP_PROMOTION_SYNC_OBSERVER_H_ |
OLD | NEW |