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

Side by Side Diff: ios/chrome/browser/desktop_promotion/desktop_promotion_sync_observer.h

Issue 2657673004: Add shutdown notification and service refs to SyncServiceObserver. (Closed)
Patch Set: Chromeos fix Created 3 years, 10 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
OLDNEW
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698