2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-03 23:15:31 +00:00
This reverts commit 5d65ba087e6b30a2a34b73b34e15b03bfecace0d.
This commit is contained in:
Roger Yang 2021-08-05 11:14:56 -04:00 committed by mergify[bot]
parent cffad4f424
commit 333840f02e
7 changed files with 0 additions and 95 deletions

View File

@ -6019,52 +6019,3 @@ recent_tabs:
notification_emails: notification_emails:
- android-probes@mozilla.com - android-probes@mozilla.com
expires: "2022-06-23" expires: "2022-06-23"
credit_cards:
manual_save:
type: counter
description: |
A counter of the number of credit cards that have been saved
manually by the user.
send_in_pings:
- metrics
bugs:
- https://github.com/mozilla-mobile/fenix/issues/18711
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/19548#issuecomment-848811030
data_sensitivity:
- interaction
notification_emails:
- fenix-core@mozilla.com
expires: "2021-10-01"
delete_card:
type: counter
description: |
A counter of the number of credit cards that have been deleted by
the user.
send_in_pings:
- metrics
bugs:
- https://github.com/mozilla-mobile/fenix/issues/18711
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/19548#issuecomment-848811030
data_sensitivity:
- interaction
notification_emails:
- fenix-core@mozilla.com
expires: "2021-10-01"
autofill_card:
type: counter
description: |
A counter of the number of times the user has autofilled
a credit card.
send_in_pings:
- metrics
bugs:
- https://github.com/mozilla-mobile/fenix/issues/18711
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/19548#issuecomment-848811030
data_sensitivity:
- interaction
notification_emails:
- fenix-core@mozilla.com
expires: "2021-10-01"

View File

@ -257,11 +257,6 @@ sealed class Event {
object AndroidAutofillRequestWithLogins : Event() object AndroidAutofillRequestWithLogins : Event()
object AndroidAutofillRequestWithoutLogins : Event() object AndroidAutofillRequestWithoutLogins : Event()
// Credit cards
object CreditCardManualSave : Event()
object CreditCardDelete : Event()
object CreditCardAutofill : Event()
// Interaction events with extras // Interaction events with extras
data class TopSiteSwipeCarousel(val page: Int) : Event() { data class TopSiteSwipeCarousel(val page: Int) : Event() {

View File

@ -23,7 +23,6 @@ import org.mozilla.fenix.GleanMetrics.ContextMenu
import org.mozilla.fenix.GleanMetrics.ContextualHintTrackingProtection import org.mozilla.fenix.GleanMetrics.ContextualHintTrackingProtection
import org.mozilla.fenix.GleanMetrics.ContextualMenu import org.mozilla.fenix.GleanMetrics.ContextualMenu
import org.mozilla.fenix.GleanMetrics.CrashReporter import org.mozilla.fenix.GleanMetrics.CrashReporter
import org.mozilla.fenix.GleanMetrics.CreditCards
import org.mozilla.fenix.GleanMetrics.CustomTab import org.mozilla.fenix.GleanMetrics.CustomTab
import org.mozilla.fenix.GleanMetrics.DownloadNotification import org.mozilla.fenix.GleanMetrics.DownloadNotification
import org.mozilla.fenix.GleanMetrics.DownloadsMisc import org.mozilla.fenix.GleanMetrics.DownloadsMisc
@ -876,16 +875,6 @@ private val Event.wrapper: EventWrapper<*>?
) )
is Event.AndroidAutofillConfirmationSuccessful -> EventWrapper<NoExtraKeys>( is Event.AndroidAutofillConfirmationSuccessful -> EventWrapper<NoExtraKeys>(
{ AndroidAutofill.confirmSuccessful.record(it) } { AndroidAutofill.confirmSuccessful.record(it) }
// Credit cards
is Event.CreditCardManualSave -> EventWrapper<NoExtraKeys>(
{ CreditCards.manualSave.add(1) }
)
is Event.CreditCardDelete -> EventWrapper<NoExtraKeys>(
{ CreditCards.deleteCard.add(1) }
)
is Event.CreditCardAutofill -> EventWrapper<NoExtraKeys>(
{ CreditCards.autofillCard.add(1) }
) )
// Don't record other events in Glean: // Don't record other events in Glean:

View File

@ -22,7 +22,6 @@ import mozilla.components.feature.downloads.facts.DownloadsFacts
import mozilla.components.feature.findinpage.facts.FindInPageFacts import mozilla.components.feature.findinpage.facts.FindInPageFacts
import mozilla.components.feature.media.facts.MediaFacts import mozilla.components.feature.media.facts.MediaFacts
import mozilla.components.feature.prompts.facts.LoginDialogFacts import mozilla.components.feature.prompts.facts.LoginDialogFacts
import mozilla.components.feature.prompts.facts.CreditCardAutofillDialogFacts
import mozilla.components.feature.pwa.ProgressiveWebAppFacts import mozilla.components.feature.pwa.ProgressiveWebAppFacts
import mozilla.components.feature.search.telemetry.ads.AdsTelemetry import mozilla.components.feature.search.telemetry.ads.AdsTelemetry
import mozilla.components.feature.search.telemetry.incontent.InContentTelemetry import mozilla.components.feature.search.telemetry.incontent.InContentTelemetry
@ -165,8 +164,6 @@ internal class ReleaseMetricController(
Component.FEATURE_PROMPTS to LoginDialogFacts.Items.CANCEL -> Event.LoginDialogPromptCancelled Component.FEATURE_PROMPTS to LoginDialogFacts.Items.CANCEL -> Event.LoginDialogPromptCancelled
Component.FEATURE_PROMPTS to LoginDialogFacts.Items.NEVER_SAVE -> Event.LoginDialogPromptNeverSave Component.FEATURE_PROMPTS to LoginDialogFacts.Items.NEVER_SAVE -> Event.LoginDialogPromptNeverSave
Component.FEATURE_PROMPTS to LoginDialogFacts.Items.SAVE -> Event.LoginDialogPromptSave Component.FEATURE_PROMPTS to LoginDialogFacts.Items.SAVE -> Event.LoginDialogPromptSave
Component.FEATURE_PROMPTS to CreditCardAutofillDialogFacts.Items.AUTOFILL_CREDIT_CARD_SUCCESS ->
Event.CreditCardAutofill
Component.FEATURE_FINDINPAGE to FindInPageFacts.Items.CLOSE -> Event.FindInPageClosed Component.FEATURE_FINDINPAGE to FindInPageFacts.Items.CLOSE -> Event.FindInPageClosed
Component.FEATURE_FINDINPAGE to FindInPageFacts.Items.INPUT -> Event.FindInPageSearchCommitted Component.FEATURE_FINDINPAGE to FindInPageFacts.Items.INPUT -> Event.FindInPageSearchCommitted

View File

@ -56,7 +56,6 @@ class CreditCardEditorFragment : SecureFragment(R.layout.fragment_credit_card_ed
val storage = requireContext().components.core.autofillStorage val storage = requireContext().components.core.autofillStorage
interactor = DefaultCreditCardEditorInteractor( interactor = DefaultCreditCardEditorInteractor(
controller = DefaultCreditCardEditorController( controller = DefaultCreditCardEditorController(
context = requireContext(),
storage = storage, storage = storage,
lifecycleScope = lifecycleScope, lifecycleScope = lifecycleScope,
navController = findNavController() navController = findNavController()

View File

@ -4,7 +4,6 @@
package org.mozilla.fenix.settings.creditcards.controller package org.mozilla.fenix.settings.creditcards.controller
import android.content.Context
import androidx.navigation.NavController import androidx.navigation.NavController
import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
@ -13,10 +12,8 @@ import kotlinx.coroutines.launch
import mozilla.components.concept.storage.NewCreditCardFields import mozilla.components.concept.storage.NewCreditCardFields
import mozilla.components.concept.storage.UpdatableCreditCardFields import mozilla.components.concept.storage.UpdatableCreditCardFields
import mozilla.components.service.sync.autofill.AutofillCreditCardsAddressesStorage import mozilla.components.service.sync.autofill.AutofillCreditCardsAddressesStorage
import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.settings.creditcards.CreditCardEditorFragment import org.mozilla.fenix.settings.creditcards.CreditCardEditorFragment
import org.mozilla.fenix.settings.creditcards.interactor.CreditCardEditorInteractor import org.mozilla.fenix.settings.creditcards.interactor.CreditCardEditorInteractor
import org.mozilla.fenix.ext.components
/** /**
* [CreditCardEditorFragment] controller. An interface that handles the view manipulation of the * [CreditCardEditorFragment] controller. An interface that handles the view manipulation of the
@ -55,15 +52,12 @@ interface CreditCardEditorController {
* @param ioDispatcher [CoroutineDispatcher] used for executing async tasks. Defaults to [Dispatchers.IO]. * @param ioDispatcher [CoroutineDispatcher] used for executing async tasks. Defaults to [Dispatchers.IO].
*/ */
class DefaultCreditCardEditorController( class DefaultCreditCardEditorController(
context: Context,
private val storage: AutofillCreditCardsAddressesStorage, private val storage: AutofillCreditCardsAddressesStorage,
private val lifecycleScope: CoroutineScope, private val lifecycleScope: CoroutineScope,
private val navController: NavController, private val navController: NavController,
private val ioDispatcher: CoroutineDispatcher = Dispatchers.IO private val ioDispatcher: CoroutineDispatcher = Dispatchers.IO
) : CreditCardEditorController { ) : CreditCardEditorController {
private val metrics = context.components.analytics.metrics
override fun handleCancelButtonClicked() { override fun handleCancelButtonClicked() {
navController.popBackStack() navController.popBackStack()
} }
@ -71,7 +65,6 @@ class DefaultCreditCardEditorController(
override fun handleDeleteCreditCard(guid: String) { override fun handleDeleteCreditCard(guid: String) {
lifecycleScope.launch(ioDispatcher) { lifecycleScope.launch(ioDispatcher) {
storage.deleteCreditCard(guid) storage.deleteCreditCard(guid)
metrics.track(Event.CreditCardDelete)
lifecycleScope.launch(Dispatchers.Main) { lifecycleScope.launch(Dispatchers.Main) {
navController.popBackStack() navController.popBackStack()
@ -82,7 +75,6 @@ class DefaultCreditCardEditorController(
override fun handleSaveCreditCard(creditCardFields: NewCreditCardFields) { override fun handleSaveCreditCard(creditCardFields: NewCreditCardFields) {
lifecycleScope.launch(ioDispatcher) { lifecycleScope.launch(ioDispatcher) {
storage.addCreditCard(creditCardFields) storage.addCreditCard(creditCardFields)
metrics.track(Event.CreditCardManualSave)
lifecycleScope.launch(Dispatchers.Main) { lifecycleScope.launch(Dispatchers.Main) {
navController.popBackStack() navController.popBackStack()

View File

@ -4,10 +4,8 @@
package org.mozilla.fenix.settings.creditcards package org.mozilla.fenix.settings.creditcards
import android.content.Context
import androidx.navigation.NavController import androidx.navigation.NavController
import io.mockk.coVerify import io.mockk.coVerify
import io.mockk.every
import io.mockk.mockk import io.mockk.mockk
import io.mockk.spyk import io.mockk.spyk
import io.mockk.verify import io.mockk.verify
@ -25,15 +23,9 @@ import org.junit.After
import org.junit.Before import org.junit.Before
import org.junit.Rule import org.junit.Rule
import org.junit.Test import org.junit.Test
import org.junit.runner.RunWith
import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.components.metrics.MetricController
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.helpers.FenixRobolectricTestRunner
import org.mozilla.fenix.settings.creditcards.controller.DefaultCreditCardEditorController import org.mozilla.fenix.settings.creditcards.controller.DefaultCreditCardEditorController
@ExperimentalCoroutinesApi @ExperimentalCoroutinesApi
@RunWith(FenixRobolectricTestRunner::class)
class DefaultCreditCardEditorControllerTest { class DefaultCreditCardEditorControllerTest {
private val storage: AutofillCreditCardsAddressesStorage = mockk(relaxed = true) private val storage: AutofillCreditCardsAddressesStorage = mockk(relaxed = true)
@ -43,22 +35,14 @@ class DefaultCreditCardEditorControllerTest {
private val testDispatcher = TestCoroutineDispatcher() private val testDispatcher = TestCoroutineDispatcher()
private lateinit var controller: DefaultCreditCardEditorController private lateinit var controller: DefaultCreditCardEditorController
private lateinit var context: Context
private lateinit var metrics: MetricController
@get:Rule @get:Rule
val coroutinesTestRule = MainCoroutineRule(testDispatcher) val coroutinesTestRule = MainCoroutineRule(testDispatcher)
@Before @Before
fun setup() { fun setup() {
metrics = mockk()
context = mockk()
every { metrics.track(any()) } returns Unit
every { context.components.analytics.metrics } returns metrics
controller = spyk( controller = spyk(
DefaultCreditCardEditorController( DefaultCreditCardEditorController(
context = context,
storage = storage, storage = storage,
lifecycleScope = testCoroutineScope, lifecycleScope = testCoroutineScope,
navController = navController, navController = navController,
@ -91,7 +75,6 @@ class DefaultCreditCardEditorControllerTest {
coVerify { coVerify {
storage.deleteCreditCard(creditCardId) storage.deleteCreditCard(creditCardId)
navController.popBackStack() navController.popBackStack()
metrics.track(Event.CreditCardDelete)
} }
} }
@ -111,7 +94,6 @@ class DefaultCreditCardEditorControllerTest {
coVerify { coVerify {
storage.addCreditCard(creditCardFields) storage.addCreditCard(creditCardFields)
navController.popBackStack() navController.popBackStack()
metrics.track(Event.CreditCardManualSave)
} }
} }