Commit d6124a7b authored by Caroline Rising's avatar Caroline Rising Committed by Chromium LUCI CQ

Read later: Add metric for bookmark icon menu choice.

Add a new histogram to track the option selected from the bookmark icon
menu.

Bug: 1163938
Change-Id: I9e644c447c9c5ac499db3ab58d70f17cb6ae153e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2616139
Commit-Queue: Caroline Rising <corising@chromium.org>
Reviewed-by: default avatarMark Pearson <mpearson@chromium.org>
Reviewed-by: default avatarConnie Wan <connily@chromium.org>
Cr-Commit-Position: refs/heads/master@{#842547}
parent 12e9f63e
......@@ -6,6 +6,7 @@
#include <string>
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_number_conversions.h"
#include "chrome/app/chrome_command_ids.h"
......@@ -30,6 +31,25 @@
#include "ui/gfx/paint_vector_icon.h"
#include "ui/views/controls/menu/menu_runner.h"
namespace {
// Enumeration of all actions in the star menu.
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class Action {
kAddBookmarkButton = 0,
kEditBookmarkButton = 1,
kAddToReadingListButton = 2,
kMarkAsReadButton = 3,
kMaxValue = kMarkAsReadButton,
};
void RecordClick(Action item) {
base::UmaHistogramEnumeration("Bookmarks.StarEntryPoint.ClickedAction", item);
}
} // namespace
StarView::StarView(CommandUpdater* command_updater,
Browser* browser,
IconLabelBubbleView::Delegate* icon_label_bubble_delegate,
......@@ -114,12 +134,16 @@ void StarView::EditBookmarksPrefUpdated() {
void StarView::ExecuteCommand(int command_id, int event_flags) {
switch (command_id) {
case StarMenuModel::CommandBookmark:
RecordClick(GetActive() ? Action::kEditBookmarkButton
: Action::kAddBookmarkButton);
chrome::BookmarkCurrentTab(browser_);
break;
case StarMenuModel::CommandMoveToReadLater:
RecordClick(Action::kAddToReadingListButton);
chrome::MoveCurrentTabToReadLater(browser_);
break;
case StarMenuModel::CommandMarkAsRead:
RecordClick(Action::kMarkAsReadButton);
chrome::MarkCurrentTabAsReadInReadLater(browser_);
break;
default:
......
......@@ -71397,6 +71397,13 @@ https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_2.7.1.pdf
<int value="20" label="OTHER"/>
</enum>
<enum name="StarEntryPointAction">
<int value="0" label="Add bookmark"/>
<int value="1" label="Edit bookmark"/>
<int value="2" label="Add to reading list"/>
<int value="3" label="Mark as read"/>
</enum>
<enum name="StarsLaunchLocation">
<obsolete>
Removed 01/2020 as we no longer record this metric.
......@@ -1782,6 +1782,15 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</summary>
</histogram>
<histogram name="Bookmarks.StarEntryPoint.ClickedAction"
enum="StarEntryPointAction" expires_after="M92">
<owner>corising@chromium.org</owner>
<owner>chrome-desktop-ui-sea@google.com</owner>
<summary>
Recorded when an action in the Bookmark icon menu is clicked.
</summary>
</histogram>
<histogram name="Bookmarks.UsageCountPerProfileType" enum="BrowserProfileType"
expires_after="2021-06-01">
<owner>rhalavati@chromium.org</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