| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_DESKTOP_IOS_PROMOTION_DESKTOP_IOS_PROMOTION_UTIL_H_ | 5 #ifndef CHROME_BROWSER_UI_DESKTOP_IOS_PROMOTION_DESKTOP_IOS_PROMOTION_UTIL_H_ |
| 6 #define CHROME_BROWSER_UI_DESKTOP_IOS_PROMOTION_DESKTOP_IOS_PROMOTION_UTIL_H_ | 6 #define CHROME_BROWSER_UI_DESKTOP_IOS_PROMOTION_DESKTOP_IOS_PROMOTION_UTIL_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/common/pref_names.h" | 9 #include "chrome/common/pref_names.h" |
| 10 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 // Represents the reason that the Desktop to iOS promotion was dismissed for. | 26 // Represents the reason that the Desktop to iOS promotion was dismissed for. |
| 27 // These values are written to logs. New values can be added, but existing | 27 // These values are written to logs. New values can be added, but existing |
| 28 // values must never be reordered or deleted and reused. | 28 // values must never be reordered or deleted and reused. |
| 29 enum class PromotionDismissalReason { | 29 enum class PromotionDismissalReason { |
| 30 // Focus lost is the default reason and represents no interaction. | 30 // Focus lost is the default reason and represents no interaction. |
| 31 FOCUS_LOST = 0, | 31 FOCUS_LOST = 0, |
| 32 NO_THANKS = 1, | 32 NO_THANKS = 1, |
| 33 CLOSE_BUTTON = 2, | 33 CLOSE_BUTTON = 2, |
| 34 SEND_SMS = 3, | 34 SEND_SMS = 3, |
| 35 LEARN_MORE = 4, |
| 35 // Used for histograms logging. | 36 // Used for histograms logging. |
| 36 DISMISSAL_REASON_MAX_VALUE = 4 | 37 DISMISSAL_REASON_MAX_VALUE = 5 |
| 37 }; | 38 }; |
| 38 | 39 |
| 39 enum class EntryPointLocalPrefType { IMPRESSIONS = 0, DISMISSED = 1 }; | 40 enum class EntryPointLocalPrefType { IMPRESSIONS = 0, DISMISSED = 1 }; |
| 40 | 41 |
| 41 // The place where the promotion appeared. | 42 // The place where the promotion appeared. |
| 42 // Intentionally skipped the = 0 value, as it represents the defaults on the | 43 // Intentionally skipped the = 0 value, as it represents the defaults on the |
| 43 // prefs (eg. User didn't recieve SMS). | 44 // prefs (eg. User didn't recieve SMS). |
| 44 // These values are written to logs. New values can be added, but existing | 45 // These values are written to logs. New values can be added, but existing |
| 45 // values must never be reordered or deleted and reused. | 46 // values must never be reordered or deleted and reused. |
| 46 enum class PromotionEntryPoint { | 47 enum class PromotionEntryPoint { |
| 47 SAVE_PASSWORD_BUBBLE = 1, | 48 SAVE_PASSWORD_BUBBLE = 1, |
| 48 BOOKMARKS_BUBBLE = 2, | 49 BOOKMARKS_BUBBLE = 2, |
| 49 BOOKMARKS_FOOTNOTE = 3, | 50 BOOKMARKS_FOOTNOTE = 3, |
| 50 HISTORY_PAGE = 4, | 51 HISTORY_PAGE = 4, |
| 52 FOOTNOTE_FOLLOWUP_BUBBLE = 5, |
| 51 // Used for histograms logging. | 53 // Used for histograms logging. |
| 52 ENTRY_POINT_MAX_VALUE = 5 | 54 ENTRY_POINT_MAX_VALUE = 6 |
| 53 }; | 55 }; |
| 54 | 56 |
| 55 // Entry points local prefs, each entry point has a preference for impressions | 57 // Entry points local prefs, each entry point has a preference for impressions |
| 56 // count and a preference for whether user dismissed it or not. | 58 // count and a preference for whether user dismissed it or not. |
| 57 // Do not change the order of this array, as it's indexed using | 59 // Do not change the order of this array, as it's indexed using |
| 58 // desktop_ios_promotion::PromotionEntryPoint. | 60 // desktop_ios_promotion::PromotionEntryPoint. |
| 59 const char* const kEntryPointLocalPrefs[5][2] = { | 61 const char* const kEntryPointLocalPrefs[5][2] = { |
| 60 // The first emtpy value is for padding as PromotionEntryPoints enum starts | 62 // The first emtpy value is for padding as PromotionEntryPoints enum starts |
| 61 // from 1. | 63 // from 1. |
| 62 {"", ""}, | 64 {"", ""}, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 // Register all local only Preferences. | 97 // Register all local only Preferences. |
| 96 void RegisterLocalPrefs(PrefRegistrySimple* registry); | 98 void RegisterLocalPrefs(PrefRegistrySimple* registry); |
| 97 | 99 |
| 98 // Log promotion dismissal reason for entry points. | 100 // Log promotion dismissal reason for entry points. |
| 99 void LogDismissalReason(PromotionDismissalReason reason, | 101 void LogDismissalReason(PromotionDismissalReason reason, |
| 100 PromotionEntryPoint entry_point); | 102 PromotionEntryPoint entry_point); |
| 101 | 103 |
| 102 } // namespace desktop_ios_promotion | 104 } // namespace desktop_ios_promotion |
| 103 | 105 |
| 104 #endif // CHROME_BROWSER_UI_DESKTOP_IOS_PROMOTION_DESKTOP_IOS_PROMOTION_UTIL_H_ | 106 #endif // CHROME_BROWSER_UI_DESKTOP_IOS_PROMOTION_DESKTOP_IOS_PROMOTION_UTIL_H_ |
| OLD | NEW |