Commit 375f71d3 authored by Tanisha Mandre's avatar Tanisha Mandre Committed by Commit Bot

Add credit card screen metrics

- MobileAddCreditCard.AddPaymentMethodButton - Entry point from settings.
- Modify ManualFallback_CreditCard_OpenAddPaymentMethod - Entry point from manual fallback.
- MobileAddCreditCard.AddButton - Save a new card using the 'Add' button.

Bug:1002512

Change-Id: I20ab8faf3b40345b21e00a37d801d6ae666b557b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1796357Reviewed-by: default avatarJavier Ernesto Flores Robles <javierrobles@chromium.org>
Reviewed-by: default avatarBrian White <bcwhite@chromium.org>
Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Commit-Queue: Tanisha Mandre <tanishamandre@google.com>
Cr-Commit-Position: refs/heads/master@{#696732}
parent 95a6ac68
......@@ -134,7 +134,7 @@ NSString* const ManageCardsAccessibilityIdentifier =
initWithTitle:addCreditCardsTitle
action:^{
base::RecordAction(base::UserMetricsAction(
"ManualFallback_CreditCard_OpenAddCreditCard"));
"ManualFallback_CreditCard_OpenAddPaymentMethod"));
// TODO(crbug.com/984561): Add action to navigate to the add
// credit card details screen here.
}];
......
......@@ -4,6 +4,7 @@
#import "ios/chrome/browser/ui/settings/autofill/autofill_add_credit_card_mediator.h"
#include "base/metrics/user_metrics.h"
#include "base/strings/sys_string_conversions.h"
#include "components/autofill/core/browser/data_model/credit_card.h"
#include "components/autofill/core/browser/personal_data_manager.h"
......@@ -90,6 +91,8 @@
self.personalDataManager->UpdateCreditCard(savedCreditCardCopy);
} else {
base::RecordAction(
base::UserMetricsAction("MobileAddCreditCard.CardSaved"));
self.personalDataManager->AddCreditCard(creditCard);
}
......
......@@ -430,6 +430,8 @@ typedef NS_ENUM(NSInteger, ItemType) {
// credit card details.
- (void)handleAddPayment:(id)sender {
DCHECK(base::FeatureList::IsEnabled(kSettingsAddPaymentMethod));
base::RecordAction(
base::UserMetricsAction("MobileAddCreditCard.AddPaymentMethodButton"));
self.addCreditCardCoordinator = [[AutofillAddCreditCardCoordinator alloc]
initWithBaseViewController:self
......
......@@ -10696,10 +10696,10 @@ should be able to be added at any place in this file.
</description>
</action>
<action name="ManualFallback_CreditCard_OpenAddCreditCard">
<action name="ManualFallback_CreditCard_OpenAddPaymentMethod">
<owner>javierrobles@chromium.org</owner>
<description>
The user tapped on &quot;Add credit card&quot; on the Password Manual
The user tapped on &quot;Add Payment Method...&quot; on the Password Manual
Fallback view.
</description>
</action>
......@@ -11511,6 +11511,22 @@ should be able to be added at any place in this file.
</description>
</action>
<action name="MobileAddCreditCard.AddPaymentMethodButton">
<owner>gambard@chromium.org</owner>
<description>
The user tapped on &quot;Add Payment Method...&quot; in the Settings,
Payment Methods menu.
</description>
</action>
<action name="MobileAddCreditCard.CardSaved">
<owner>gambard@chromium.org</owner>
<description>
The user saved a new credit card by tapping on &quot;Add&quot; in the
Settings, Add Payment Methods menu.
</description>
</action>
<action name="MobileBeamCallbackSuccess">
<owner>Please list the metric's owners. Add more owner tags as needed.</owner>
<description>Please enter the description of this user action.</description>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment