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

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

Issue 2643723004: Add Desktop iOS promotion logging to chrome ios app. (Closed)
Patch Set: address comments / change pref name 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 352e9885cc1289bda3d24a22e92db6670e1366a2..3083ae415ba94329b4efc98829f7bd9d7a65036b 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"
@@ -340,6 +341,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;
@@ -1063,6 +1067,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