Commit 2e573ccd authored by Javier Ernesto Flores Robles's avatar Javier Ernesto Flores Robles Committed by Commit Bot

[iOS][MF] General and password actions metrics

Creates and logs user actions for the following actions.

ManualFallback_Close
ManualFallback_ClosePopover
ManualFallback_OpenPassword
ManualFallback_OpenCreditCard
ManualFallback_OpenProfile

ManualFallback_Password_SelectUsername
ManualFallback_Password_SelectPassword
ManualFallback_Password_OpenOtherPassword
ManualFallback_Password_OpenManagePassword

Bug: 845472, 881734
Change-Id: If251294575be60b9c27296e79e06a394a277762e
Reviewed-on: https://chromium-review.googlesource.com/c/1317914Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Commit-Queue: Javier Ernesto Flores Robles <javierrobles@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606408}
parent bc9a4ec8
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_accessory_view_controller.h" #import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_accessory_view_controller.h"
#include "base/metrics/user_metrics.h"
#include "components/autofill/core/common/autofill_features.h" #include "components/autofill/core/common/autofill_features.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/uicolor_manualfill.h" #import "ios/chrome/browser/ui/autofill/manual_fill/uicolor_manualfill.h"
#include "ios/chrome/browser/ui/util/ui_util.h" #include "ios/chrome/browser/ui/util/ui_util.h"
...@@ -183,12 +184,14 @@ static NSTimeInterval MFAnimationDuration = 0.20; ...@@ -183,12 +184,14 @@ static NSTimeInterval MFAnimationDuration = 0.20;
} }
- (void)keyboardButtonPressed { - (void)keyboardButtonPressed {
base::RecordAction(base::UserMetricsAction("ManualFallback_Close"));
[self animateKeyboardButtonHidden:YES]; [self animateKeyboardButtonHidden:YES];
[self resetTintColors]; [self resetTintColors];
[self.delegate keyboardButtonPressed]; [self.delegate keyboardButtonPressed];
} }
- (void)passwordButtonPressed:(UIButton*)sender { - (void)passwordButtonPressed:(UIButton*)sender {
base::RecordAction(base::UserMetricsAction("ManualFallback_OpenPassword"));
[self animateKeyboardButtonHidden:NO]; [self animateKeyboardButtonHidden:NO];
[self resetTintColors]; [self resetTintColors];
[self.passwordButton setTintColor:UIColor.cr_manualFillTintColor]; [self.passwordButton setTintColor:UIColor.cr_manualFillTintColor];
...@@ -196,6 +199,7 @@ static NSTimeInterval MFAnimationDuration = 0.20; ...@@ -196,6 +199,7 @@ static NSTimeInterval MFAnimationDuration = 0.20;
} }
- (void)cardButtonPressed { - (void)cardButtonPressed {
base::RecordAction(base::UserMetricsAction("ManualFallback_OpenCreditCard"));
[self animateKeyboardButtonHidden:NO]; [self animateKeyboardButtonHidden:NO];
[self resetTintColors]; [self resetTintColors];
[self.cardsButton setTintColor:UIColor.cr_manualFillTintColor]; [self.cardsButton setTintColor:UIColor.cr_manualFillTintColor];
...@@ -203,6 +207,7 @@ static NSTimeInterval MFAnimationDuration = 0.20; ...@@ -203,6 +207,7 @@ static NSTimeInterval MFAnimationDuration = 0.20;
} }
- (void)accountButtonPressed { - (void)accountButtonPressed {
base::RecordAction(base::UserMetricsAction("ManualFallback_OpenProfile"));
[self animateKeyboardButtonHidden:NO]; [self animateKeyboardButtonHidden:NO];
[self resetTintColors]; [self resetTintColors];
[self.accountButton setTintColor:UIColor.cr_manualFillTintColor]; [self.accountButton setTintColor:UIColor.cr_manualFillTintColor];
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_password_cell.h" #import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_password_cell.h"
#include "base/metrics/user_metrics.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/credential.h" #import "ios/chrome/browser/ui/autofill/manual_fill/credential.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_content_delegate.h" #import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_content_delegate.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/uicolor_manualfill.h" #import "ios/chrome/browser/ui/autofill/manual_fill/uicolor_manualfill.h"
...@@ -274,11 +275,15 @@ static const CGFloat BottomSystemSpacingMultiplier = 2.26; ...@@ -274,11 +275,15 @@ static const CGFloat BottomSystemSpacingMultiplier = 2.26;
} }
- (void)userDidTapUsernameButton:(UIButton*)button { - (void)userDidTapUsernameButton:(UIButton*)button {
base::RecordAction(
base::UserMetricsAction("ManualFallback_Password_SelectUsername"));
[self.delegate userDidPickContent:self.manualFillCredential.username [self.delegate userDidPickContent:self.manualFillCredential.username
isSecure:NO]; isSecure:NO];
} }
- (void)userDidTapPasswordButton:(UIButton*)button { - (void)userDidTapPasswordButton:(UIButton*)button {
base::RecordAction(
base::UserMetricsAction("ManualFallback_Password_SelectPassword"));
[self.delegate userDidPickContent:self.manualFillCredential.password [self.delegate userDidPickContent:self.manualFillCredential.password
isSecure:YES]; isSecure:YES];
} }
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#import "ios/chrome/browser/ui/autofill/manual_fill/password_coordinator.h" #import "ios/chrome/browser/ui/autofill/manual_fill/password_coordinator.h"
#include "base/metrics/user_metrics.h"
#include "components/keyed_service/core/service_access_type.h" #include "components/keyed_service/core/service_access_type.h"
#include "components/password_manager/core/browser/password_store.h" #include "components/password_manager/core/browser/password_store.h"
#include "ios/chrome/browser/passwords/ios_chrome_password_store_factory.h" #include "ios/chrome/browser/passwords/ios_chrome_password_store_factory.h"
...@@ -241,6 +242,7 @@ animationControllerForDismissedController:(UIViewController*)dismissed { ...@@ -241,6 +242,7 @@ animationControllerForDismissedController:(UIViewController*)dismissed {
- (void)popoverPresentationControllerDidDismissPopover: - (void)popoverPresentationControllerDidDismissPopover:
(UIPopoverPresentationController*)popoverPresentationController { (UIPopoverPresentationController*)popoverPresentationController {
base::RecordAction(base::UserMetricsAction("ManualFallback_ClosePopover"));
[self.delegate resetAccessoryView]; [self.delegate resetAccessoryView];
} }
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <vector> #include <vector>
#include "base/metrics/user_metrics.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#include "components/password_manager/core/browser/password_store.h" #include "components/password_manager/core/browser/password_store.h"
#import "ios/chrome/browser/autofill/manual_fill/passwords_fetcher.h" #import "ios/chrome/browser/autofill/manual_fill/passwords_fetcher.h"
...@@ -186,6 +187,8 @@ NSString* const OtherPasswordsAccessibilityIdentifier = ...@@ -186,6 +187,8 @@ NSString* const OtherPasswordsAccessibilityIdentifier =
auto otherPasswordsItem = [[ManualFillActionItem alloc] auto otherPasswordsItem = [[ManualFillActionItem alloc]
initWithTitle:otherPasswordsTitleString initWithTitle:otherPasswordsTitleString
action:^{ action:^{
base::RecordAction(base::UserMetricsAction(
"ManualFallback_Password_OpenOtherPassword"));
[weakSelf.navigationDelegate openAllPasswordsList]; [weakSelf.navigationDelegate openAllPasswordsList];
}]; }];
otherPasswordsItem.accessibilityIdentifier = otherPasswordsItem.accessibilityIdentifier =
...@@ -196,6 +199,8 @@ NSString* const OtherPasswordsAccessibilityIdentifier = ...@@ -196,6 +199,8 @@ NSString* const OtherPasswordsAccessibilityIdentifier =
auto managePasswordsItem = [[ManualFillActionItem alloc] auto managePasswordsItem = [[ManualFillActionItem alloc]
initWithTitle:managePasswordsTitle initWithTitle:managePasswordsTitle
action:^{ action:^{
base::RecordAction(base::UserMetricsAction(
"ManualFallback_Password_OpenManagePassword"));
[weakSelf.navigationDelegate openPasswordSettings]; [weakSelf.navigationDelegate openPasswordSettings];
}]; }];
managePasswordsItem.accessibilityIdentifier = managePasswordsItem.accessibilityIdentifier =
......
...@@ -10033,6 +10033,66 @@ should be able to be added at any place in this file. ...@@ -10033,6 +10033,66 @@ should be able to be added at any place in this file.
<description>The chrome://management page was viewed.</description> <description>The chrome://management page was viewed.</description>
</action> </action>
<action name="ManualFallback_Close">
<owner>javierrobles@chromium.org</owner>
<description>
The user closed the Manual Fallback view by tapping the keyboard icon.
</description>
</action>
<action name="ManualFallback_ClosePopover">
<owner>javierrobles@chromium.org</owner>
<description>
The user closed the Manual Fallback Popover view. This happens when the user
taps outside the popover.
</description>
</action>
<action name="ManualFallback_OpenCreditCard">
<owner>javierrobles@chromium.org</owner>
<description>The user opened Credit Card Manual Fallback view.</description>
</action>
<action name="ManualFallback_OpenPassword">
<owner>javierrobles@chromium.org</owner>
<description>The user opened the Password Manual Fallback view.</description>
</action>
<action name="ManualFallback_OpenProfile">
<owner>javierrobles@chromium.org</owner>
<description>The user opened the Profile Manual Fallback view.</description>
</action>
<action name="ManualFallback_Password_OpenManagePassword">
<owner>javierrobles@chromium.org</owner>
<description>
The user tapped on &quot;Manage passwords&quot; on the Password Manual
Fallback view.
</description>
</action>
<action name="ManualFallback_Password_OpenOtherPassword">
<owner>javierrobles@chromium.org</owner>
<description>
The user tapped on &quot;Use other password&quot; on the Password Manual
Fallback view.
</description>
</action>
<action name="ManualFallback_Password_SelectPassword">
<owner>javierrobles@chromium.org</owner>
<description>
The user tapped on a password in the Password Manual Fallback view.
</description>
</action>
<action name="ManualFallback_Password_SelectUsername">
<owner>javierrobles@chromium.org</owner>
<description>
The user tapped on a username in the Password Manual Fallback view.
</description>
</action>
<action name="MaxButton_Clk_ExitFS"> <action name="MaxButton_Clk_ExitFS">
<owner>Please list the metric's owners. Add more owner tags as needed.</owner> <owner>Please list the metric's owners. Add more owner tags as needed.</owner>
<description>Please enter the description of this user action.</description> <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