#include "chrome/browser/promos/promos_utils.h"
#include <string>
#include <vector>
#include "base/containers/contains.h"
#include "base/feature_list.h"
#include "base/metrics/histogram_functions.h"
#include "base/notreached.h"
#include "base/time/time.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/promos/promos_pref_names.h"
#include "chrome/browser/promos/promos_types.h"
#include "chrome/common/pref_names.h"
#include "components/feature_engagement/public/feature_constants.h"
#include "components/prefs/pref_service.h"
#include "components/segmentation_platform/embedder/default_model/device_switcher_model.h"
namespace promos_utils {
constexpr int kiOSPasswordPromoMaxImpressionCount = …;
constexpr base::TimeDelta kiOSPasswordPromoCooldownTime = …;
constexpr int kiOSDesktopPromoMaxImpressionCount = …;
constexpr int kiOSDesktopPromoTotalImpressionCount = …;
constexpr int kiOSDesktopPromoTotalOptOuts = …;
constexpr base::TimeDelta kiOSDesktopPromoCooldownTime = …;
std::string IOSDesktopPromoHistogramType(IOSPromoType promo_type) { … }
bool VerifyIOSDesktopPromoTotalImpressions(Profile* profile) { … }
bool VerifyIOSDesktopPromoTotalOptOuts(Profile* profile) { … }
bool VerifyMostRecentPromoTimestamp(Profile* profile) { … }
void RecordIOSPasswordPromoShownHistogram(int impression_count) { … }
void RecordIOSDesktopPromoShownHistogram(IOSPromoType promo_type,
int impression_count) { … }
IOSPromoPrefsConfig::IOSPromoPrefsConfig() = default;
IOSPromoPrefsConfig::IOSPromoPrefsConfig(const IOSPromoPrefsConfig&) = default;
IOSPromoPrefsConfig::~IOSPromoPrefsConfig() = default;
IOSPromoPrefsConfig::IOSPromoPrefsConfig(IOSPromoType promo_type) { … }
void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { … }
void RecordIOSPasswordPromoUserInteractionHistogram(
int impression_count,
DesktopIOSPasswordPromoAction action) { … }
void RecordIOSDesktopPromoUserInteractionHistogram(
IOSPromoType promo_type,
int impression_count,
DesktopIOSPromoAction action) { … }
bool ShouldShowIOSPasswordPromo(Profile* profile) { … }
bool ShouldShowIOSDesktopPromo(Profile* profile, IOSPromoType promo_type) { … }
bool UserNotClassifiedAsMobileDeviceSwitcher(
const segmentation_platform::ClassificationResult& result) { … }
void iOSPasswordPromoShown(Profile* profile) { … }
void IOSDesktopPromoShown(Profile* profile, IOSPromoType promo_type) { … }
}