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

Unified Diff: chrome/browser/ui/desktop_ios_promotion/desktop_ios_promotion_util.h

Issue 2694893002: Integrate SMS service with Desktop iOS promotion (Closed)
Patch Set: Addressing comments/Update phone number usage/Change view-controller relation/Pending tests 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 side-by-side diff with in-line comments
Download patch
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..05fb228fd97b4dab68b51e22f1d6c0b67b878985 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,23 +23,32 @@ 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.
Mark P 2017/02/16 23:18:57 Can you confirm that nothing caused these values t
mrefaat 2017/02/17 00:20:59 Yes, these values have not been written to logs be
enum class PromotionDismissalReason {
FOCUS_LOST = 0,
- TAB_SWITCHED,
NO_THANKS,
Mark P 2017/02/16 23:18:57 Following histogram enum best practices, please ex
mrefaat 2017/02/17 00:20:59 Done.
CLOSE_BUTTON,
SEND_SMS,
- LEARN_MORE_CLICKED,
};
+enum class EntryPointLocalPrefType { IMPRESSIONS = 0, DISMISSED = 1 };
+
// The place where the promotion appeared.
+// 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
};
+// Used with PromotionEntryPoint values as an index on kEntryPointLocalPrefs.
+constexpr int kPromotionEntrypointIndexOffset = -1;
Mark P 2017/02/16 23:18:57 Rather than do this hack, why don't you just put a
mrefaat 2017/02/17 00:20:59 I was going to do that but was afraid of confusion
+
// 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
@@ -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_

Powered by Google App Engine
This is Rietveld 408576698