| Index: chrome/browser/ui/desktop_ios_promotion/desktop_ios_promotion_util.h
|
| diff --git a/chrome/browser/ui/desktop_ios_promotion/desktop_ios_promotion_util.h b/chrome/browser/ui/desktop_ios_promotion/desktop_ios_promotion_util.h
|
| index 72b400e5eb936c5a3974e9badcbab1f1b4a5932c..83ac57bca4b7f4499b76b0e44c7092d07177cbfc 100644
|
| --- a/chrome/browser/ui/desktop_ios_promotion/desktop_ios_promotion_util.h
|
| +++ b/chrome/browser/ui/desktop_ios_promotion/desktop_ios_promotion_util.h
|
| @@ -23,28 +23,37 @@ class PrefService;
|
| namespace desktop_ios_promotion {
|
|
|
| // Represents the reason that the Desktop to iOS promotion was dismissed for.
|
| +// These values are written to logs. New values can be added, but existing
|
| +// values must never be reordered or deleted and reused.
|
| enum class PromotionDismissalReason {
|
| FOCUS_LOST = 0,
|
| - TAB_SWITCHED,
|
| - NO_THANKS,
|
| - CLOSE_BUTTON,
|
| - SEND_SMS,
|
| - LEARN_MORE_CLICKED,
|
| + NO_THANKS = 1,
|
| + CLOSE_BUTTON = 2,
|
| + SEND_SMS = 3,
|
| };
|
|
|
| +enum class EntryPointLocalPrefType { IMPRESSIONS = 0, DISMISSED = 1 };
|
| +
|
| // The place where the promotion appeared.
|
| +// Intentionally skipped the = 0 value, as it represents the defaults on the
|
| +// prefs (eg. User didn't recieve SMS).
|
| +// These values are written to logs. New values can be added, but existing
|
| +// values must never be reordered or deleted and reused.
|
| enum class PromotionEntryPoint {
|
| - SAVE_PASSWORD_BUBBLE = 0,
|
| - BOOKMARKS_BUBBLE,
|
| - BOOKMARKS_FOOTNOTE,
|
| - HISTORY_PAGE
|
| + SAVE_PASSWORD_BUBBLE = 1,
|
| + BOOKMARKS_BUBBLE = 2,
|
| + BOOKMARKS_FOOTNOTE = 3,
|
| + HISTORY_PAGE = 4,
|
| + // Used for histograms logging.
|
| + ENTRY_POINT_MAX_VALUE = 5
|
| };
|
|
|
| // Entry points local prefs, each entry point has a preference for impressions
|
| // count and a preference for whether user dismissed it or not.
|
| // Do not change the order of this array, as it's indexed using
|
| // desktop_ios_promotion::PromotionEntryPoint.
|
| -const char* const kEntryPointLocalPrefs[4][2] = {
|
| +const char* const kEntryPointLocalPrefs[5][2] = {
|
| + {"", ""},
|
| {prefs::kNumberSavePasswordsBubbleIOSPromoShown,
|
| prefs::kSavePasswordsBubbleIOSPromoDismissed},
|
| {prefs::kNumberBookmarksBubbleIOSPromoShown,
|
| @@ -56,11 +65,10 @@ const char* const kEntryPointLocalPrefs[4][2] = {
|
|
|
| bool IsEligibleForIOSPromotion(PrefService* prefs,
|
| const syncer::SyncService* sync_service,
|
| - desktop_ios_promotion::PromotionEntryPoint);
|
| + PromotionEntryPoint entry_point);
|
|
|
| // Returns the Bubble text based on the promotion entry point.
|
| -base::string16 GetPromoBubbleText(
|
| - desktop_ios_promotion::PromotionEntryPoint entry_point);
|
| +base::string16 GetPromoBubbleText(PromotionEntryPoint entry_point);
|
|
|
| // Register all Priority Sync preferences.
|
| void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
|
| @@ -68,6 +76,10 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
|
| // Register all local only Preferences.
|
| void RegisterLocalPrefs(PrefRegistrySimple* registry);
|
|
|
| +// Log promotion dismissal reason for entry points.
|
| +void LogDismissalReason(PromotionDismissalReason reason,
|
| + PromotionEntryPoint entry_point);
|
| +
|
| } // namespace desktop_ios_promotion
|
|
|
| #endif // CHROME_BROWSER_UI_DESKTOP_IOS_PROMOTION_DESKTOP_IOS_PROMOTION_UTIL_H_
|
|
|