Skip to content

Commit

Permalink
[iOS][Toolbar][119] Log selected omnibox position
Browse files Browse the repository at this point in the history
Log the selected omnibox position when starting the app.

(cherry picked from commit 00d3514)

Bug: 1496338
Change-Id: Ie00a1b13f9177311ee4875dcd6827eafd6809bf8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4979887
Reviewed-by: Gauthier Ambard <gambard@chromium.org>
Commit-Queue: Christian Xu <christianxu@chromium.org>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Olivier Robin <olivierrobin@chromium.org>
Auto-Submit: Christian Xu <christianxu@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1216089}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4987636
Reviewed-by: Erhu Akpobaro <eakpobaro@google.com>
Commit-Queue: Olivier Robin <olivierrobin@chromium.org>
Cr-Commit-Position: refs/branch-heads/6045@{#1289}
Cr-Branched-From: 905e8bd-refs/heads/main@{#1204232}
  • Loading branch information
ChristianXuG authored and Chromium LUCI CQ committed Nov 10, 2023
1 parent b919c60 commit b8eb66d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
// This is used to measure the population for each omnibox position.
extern const char kOmniboxSteadyStatePositionAtStartup[];

// Logs the selected steady state (unfocused) omnibox position when starting the
// app. This only logged when the position is user selected.
extern const char kOmniboxSteadyStatePositionAtStartupSelected[];

// Enum for the IOS.Omnibox.SteadyStatePosition histogram.
// Keep in sync with "OmniboxPositionType"
// in src/tools/metrics/histograms/enums.xml.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
const char kOmniboxSteadyStatePositionAtStartup[] =
"IOS.Omnibox.SteadyStatePositionAtStartup";

const char kOmniboxSteadyStatePositionAtStartupSelected[] =
"IOS.Omnibox.SteadyStatePositionAtStartup.Selected";

const char kOmniboxDeviceSwitcherResultAtStartup[] =
"IOS.Omnibox.DeviceSwitcherResult.AtStartup";

Expand Down
5 changes: 5 additions & 0 deletions ios/chrome/browser/ui/toolbar/toolbar_mediator.mm
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,11 @@ - (void)logOmniboxPosition {
: OmniboxPositionType::kTop;
base::UmaHistogramEnumeration(kOmniboxSteadyStatePositionAtStartup,
positionType);

if (self.prefService->GetUserPrefValue(prefs::kBottomOmnibox)) {
base::UmaHistogramEnumeration(
kOmniboxSteadyStatePositionAtStartupSelected, positionType);
}
});
}

Expand Down
10 changes: 10 additions & 0 deletions tools/metrics/histograms/metadata/ios/histograms.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1675,6 +1675,16 @@ chromium-metrics-reviews@google.com.
</summary>
</histogram>

<histogram name="IOS.Omnibox.SteadyStatePositionAtStartup.Selected"
enum="OmniboxPositionType" expires_after="2024-01-28">
<owner>christianxu@chromium.org</owner>
<owner>bling-team@google.com</owner>
<summary>
Logs the selected steady state (unfocused) omnibox position when starting
the app. This only logged when the position is user selected.
</summary>
</histogram>

<histogram name="IOS.Omnibox.SuggestionsListScrolled.{PageClass}"
enum="Boolean" expires_after="2024-01-31">
<owner>christianxu@chromium.org</owner>
Expand Down

0 comments on commit b8eb66d

Please sign in to comment.