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

Unified Diff: ios/chrome/app/main_controller.mm

Issue 2643723004: Add Desktop iOS promotion logging to chrome ios app. (Closed)
Patch Set: CL Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/app/main_controller.mm
diff --git a/ios/chrome/app/main_controller.mm b/ios/chrome/app/main_controller.mm
index 291afaf25c157b84ec53d43c90e14adf54c44158..22b614e0756284f5a15c5c6da5fde8cab28ca223 100644
--- a/ios/chrome/app/main_controller.mm
+++ b/ios/chrome/app/main_controller.mm
@@ -71,6 +71,7 @@
#include "ios/chrome/browser/crash_report/breakpad_helper.h"
#import "ios/chrome/browser/crash_report/crash_report_background_uploader.h"
#import "ios/chrome/browser/crash_report/crash_restore_helper.h"
+#include "ios/chrome/browser/desktop_promotion/desktop_promotion_sync_observer.h"
#include "ios/chrome/browser/experimental_flags.h"
#include "ios/chrome/browser/file_metadata_util.h"
#import "ios/chrome/browser/first_run/first_run.h"
@@ -335,6 +336,9 @@ enum class StackViewDismissalMode { NONE, NORMAL, INCOGNITO };
// Bridge to listen to pref changes.
std::unique_ptr<PrefObserverBridge> _localStatePrefObserverBridge;
+ // Sync service observer for the desktop ios promotion logging.
+ std::unique_ptr<DesktopPromotionSyncObserver> _desktopPromotionSyncObserver;
+
// Registrar for pref changes notifications to the local state.
PrefChangeRegistrar _localStatePrefChangeRegistrar;
@@ -1059,6 +1063,11 @@ enum class StackViewDismissalMode { NONE, NORMAL, INCOGNITO };
prefs::kMetricsReportingWifiOnly,
&_localStatePrefChangeRegistrar);
+ // Track Sync state changes.
+ _desktopPromotionSyncObserver.reset(
+ new DesktopPromotionSyncObserver(
+ [self currentBrowserState]));
+
// Calls the onPreferenceChanged function in case there was
// a
// change to the observed preferences before the observer

Powered by Google App Engine
This is Rietveld 408576698