Commit ce389c1d authored by Chris Lu's avatar Chris Lu Committed by Commit Bot

[ios] Add URL open user metric actions

Adds user metric actions for default browser and first party
URL opens. This will be used observe user action sequences.

Bug: 1107489
Change-Id: I7ba0290912a5568219c13b8c4c246d86d4ebf3c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2399084Reviewed-by: default avatarMark Pearson <mpearson@chromium.org>
Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Commit-Queue: Chris Lu <thegreenfrog@chromium.org>
Cr-Commit-Position: refs/heads/master@{#806063}
parent 27397cec
......@@ -6,6 +6,7 @@
#include "base/mac/foundation_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h"
#include "base/metrics/user_metrics_action.h"
#include "base/strings/sys_string_conversions.h"
#include "ios/chrome/browser/chrome_url_constants.h"
......@@ -168,13 +169,18 @@ enum SearchExtensionAction {
MobileSessionStartAction action = START_ACTION_OTHER;
if (gurl.SchemeIs(url::kHttpScheme)) {
action = START_ACTION_OPEN_HTTP_FROM_OS;
base::RecordAction(
base::UserMetricsAction("MobileDefaultBrowserViewIntent"));
} else if (gurl.SchemeIs(url::kHttpsScheme)) {
action = START_ACTION_OPEN_HTTPS_FROM_OS;
base::RecordAction(
base::UserMetricsAction("MobileDefaultBrowserViewIntent"));
} else {
// Replace the scheme with https or http depending on whether the input
// |url| scheme ends with an 's'.
BOOL useHttps = gurl.scheme()[gurl.scheme().length() - 1] == 's';
action = useHttps ? START_ACTION_OPEN_HTTPS : START_ACTION_OPEN_HTTP;
base::RecordAction(base::UserMetricsAction("MobileFirstPartyViewIntent"));
GURL::Replacements replace_scheme;
if (useHttps)
......
......@@ -13434,6 +13434,13 @@ should be able to be added at any place in this file.
</description>
</action>
<action name="MobileDefaultBrowserViewIntent">
<owner>thegreenfrog@chromium.org</owner>
<description>
Records when an iOS user opens the app from the default browser URL open.
</description>
</action>
<action name="MobileDownloadFileUIInstallGoogleDrive">
<obsolete>
Removed in 12/2019 after adds of IOSDownloadFileUIGoogleDrive's histogram.
......@@ -13515,6 +13522,13 @@ should be able to be added at any place in this file.
<description>Please enter the description of this user action.</description>
</action>
<action name="MobileFirstPartyViewIntent">
<owner>thegreenfrog@chromium.org</owner>
<description>
Records when an iOS user opens the app from a Google first party app.
</description>
</action>
<action name="MobileFocusedFakeboxOnNtp">
<obsolete>Deprecated as of 12/2015</obsolete>
<owner>Please list the metric's owners. Add more owner tags as needed.</owner>
......
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