Commit 92dbb3de authored by Thomas Tangl's avatar Thomas Tangl Committed by Commit Bot

[profile-menu] Add separate user actions for regular/guest/incognito

Bug: 995720
Change-Id: I9616c6c0e270059fb220df87b5d60936e69f8a34
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1864663
Commit-Queue: Thomas Tangl <tangltom@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Reviewed-by: default avatarBrian White <bcwhite@chromium.org>
Cr-Commit-Position: refs/heads/master@{#707824}
parent a3bfd0c0
...@@ -365,6 +365,13 @@ void RecordAnimatedIdentityTriggered(Profile* profile) { ...@@ -365,6 +365,13 @@ void RecordAnimatedIdentityTriggered(Profile* profile) {
void RecordProfileMenuViewShown(Profile* profile) { void RecordProfileMenuViewShown(Profile* profile) {
base::RecordAction(base::UserMetricsAction("ProfileMenu_Opened")); base::RecordAction(base::UserMetricsAction("ProfileMenu_Opened"));
if (profile->IsRegularProfile()) {
base::RecordAction(base::UserMetricsAction("ProfileMenu_Opened_Regular"));
} else if (profile->IsGuestSession()) {
base::RecordAction(base::UserMetricsAction("ProfileMenu_Opened_Guest"));
} else if (profile->IsIncognitoProfile()) {
base::RecordAction(base::UserMetricsAction("ProfileMenu_Opened_Incognito"));
}
base::TimeTicks animation_last_shown = base::TimeTicks animation_last_shown =
AnimatedIdentityUserData::GetLastShown(profile); AnimatedIdentityUserData::GetLastShown(profile);
...@@ -375,4 +382,19 @@ void RecordProfileMenuViewShown(Profile* profile) { ...@@ -375,4 +382,19 @@ void RecordProfileMenuViewShown(Profile* profile) {
base::TimeTicks::Now() - animation_last_shown); base::TimeTicks::Now() - animation_last_shown);
} }
void RecordProfileMenuClick(Profile* profile) {
base::RecordAction(
base::UserMetricsAction("ProfileMenu_ActionableItemClicked"));
if (profile->IsRegularProfile()) {
base::RecordAction(
base::UserMetricsAction("ProfileMenu_ActionableItemClicked_Regular"));
} else if (profile->IsGuestSession()) {
base::RecordAction(
base::UserMetricsAction("ProfileMenu_ActionableItemClicked_Guest"));
} else if (profile->IsIncognitoProfile()) {
base::RecordAction(
base::UserMetricsAction("ProfileMenu_ActionableItemClicked_Incognito"));
}
}
} // namespace signin_ui_util } // namespace signin_ui_util
...@@ -109,6 +109,9 @@ void RecordAnimatedIdentityTriggered(Profile* profile); ...@@ -109,6 +109,9 @@ void RecordAnimatedIdentityTriggered(Profile* profile);
// Called when the ProfileMenuView is opened. Used for metrics. // Called when the ProfileMenuView is opened. Used for metrics.
void RecordProfileMenuViewShown(Profile* profile); void RecordProfileMenuViewShown(Profile* profile);
// Called when a button/link in the profile menu was clicked.
void RecordProfileMenuClick(Profile* profile);
} // namespace signin_ui_util } // namespace signin_ui_util
#endif // CHROME_BROWSER_SIGNIN_SIGNIN_UI_UTIL_H_ #endif // CHROME_BROWSER_SIGNIN_SIGNIN_UI_UTIL_H_
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "base/feature_list.h" #include "base/feature_list.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_functions.h"
#include "base/metrics/user_metrics.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/app/vector_icons/vector_icons.h" #include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
...@@ -575,8 +574,7 @@ void ProfileMenuViewBase::StyledLabelLinkClicked(views::StyledLabel* link, ...@@ -575,8 +574,7 @@ void ProfileMenuViewBase::StyledLabelLinkClicked(views::StyledLabel* link,
void ProfileMenuViewBase::OnClick(views::View* clickable_view) { void ProfileMenuViewBase::OnClick(views::View* clickable_view) {
DCHECK(!click_actions_[clickable_view].is_null()); DCHECK(!click_actions_[clickable_view].is_null());
base::RecordAction( signin_ui_util::RecordProfileMenuClick(browser()->profile());
base::UserMetricsAction("ProfileMenu_ActionableItemClicked"));
click_actions_[clickable_view].Run(); click_actions_[clickable_view].Run();
} }
......
...@@ -17709,12 +17709,54 @@ should be able to be added at any place in this file. ...@@ -17709,12 +17709,54 @@ should be able to be added at any place in this file.
</description> </description>
</action> </action>
<action name="ProfileMenu_ActionableItemClicked_Guest">
<owner>droger@chromium.org</owner>
<owner>tangltom@chromium.org</owner>
<description>
The user clicked a button or a link in the guest profile menu.
</description>
</action>
<action name="ProfileMenu_ActionableItemClicked_Incognito">
<owner>droger@chromium.org</owner>
<owner>tangltom@chromium.org</owner>
<description>
The user clicked a button or a link in the incognito profile menu.
</description>
</action>
<action name="ProfileMenu_ActionableItemClicked_Regular">
<owner>droger@chromium.org</owner>
<owner>tangltom@chromium.org</owner>
<description>
The user clicked a button or a link in the regular profile menu.
</description>
</action>
<action name="ProfileMenu_Opened"> <action name="ProfileMenu_Opened">
<owner>msarda@chromium.org</owner> <owner>msarda@chromium.org</owner>
<owner>tangltom@chromium.org</owner> <owner>tangltom@chromium.org</owner>
<description>The user opened the profile menu.</description> <description>The user opened the profile menu.</description>
</action> </action>
<action name="ProfileMenu_Opened_Guest">
<owner>droger@chromium.org</owner>
<owner>tangltom@chromium.org</owner>
<description>The user opened the guest profile menu.</description>
</action>
<action name="ProfileMenu_Opened_Incognito">
<owner>droger@chromium.org</owner>
<owner>tangltom@chromium.org</owner>
<description>The user opened the incognito profile menu.</description>
</action>
<action name="ProfileMenu_Opened_Regular">
<owner>droger@chromium.org</owner>
<owner>tangltom@chromium.org</owner>
<description>The user opened the regular profile menu.</description>
</action>
<action name="PWAInstallIcon"> <action name="PWAInstallIcon">
<owner>alancutter@chromium.org</owner> <owner>alancutter@chromium.org</owner>
<description> <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