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

Read later: Add user action metrics

Add user action metrics for:
- Clicking to open the reading list
- Adding to the reading list from the Bookmark icon entry point
- Adding to the reading list from the tab context menu

Bug: 1163938
Change-Id: I95d655ce60f5b76c80f4d3b6a8490310befa8fac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2622315
Commit-Queue: Caroline Rising <corising@chromium.org>
Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Reviewed-by: default avatarDana Fried <dfried@chromium.org>
Cr-Commit-Position: refs/heads/master@{#842589}
parent e9bd1430
......@@ -1419,6 +1419,8 @@ void TabStripModel::ExecuteContextMenuCommand(int context_index,
}
case CommandAddToReadLater: {
base::RecordAction(
UserMetricsAction("DesktopReadingList.AddItem.FromTabContextMenu"));
AddToReadLater(GetIndicesForCommand(context_index));
break;
}
......
......@@ -8,6 +8,8 @@
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h"
#include "base/metrics/user_metrics_action.h"
#include "base/strings/string_number_conversions.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/defaults.h"
......@@ -140,6 +142,8 @@ void StarView::ExecuteCommand(int command_id, int event_flags) {
break;
case StarMenuModel::CommandMoveToReadLater:
RecordClick(Action::kAddToReadingListButton);
base::RecordAction(base::UserMetricsAction(
"DesktopReadingList.AddItem.FromBookmarkIcon"));
chrome::MoveCurrentTabToReadLater(browser_);
break;
case StarMenuModel::CommandMarkAsRead:
......
......@@ -4,6 +4,8 @@
#include "chrome/browser/ui/views/read_later/read_later_button.h"
#include "base/metrics/user_metrics.h"
#include "base/metrics/user_metrics_action.h"
#include "base/strings/string16.h"
#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/profiles/profile.h"
......@@ -119,6 +121,8 @@ void ReadLaterButton::ButtonPressed() {
if (webui_bubble_manager_->GetBubbleWidget()) {
webui_bubble_manager_->CloseBubble();
} else {
base::RecordAction(
base::UserMetricsAction("DesktopReadingList.OpenReadingList"));
webui_bubble_manager_->ShowBubble();
}
}
......
......@@ -5893,6 +5893,32 @@ should be able to be added at any place in this file.
</description>
</action>
<action name="DesktopReadingList.AddItem.FromBookmarkIcon">
<owner>corising@chromium.org</owner>
<owner>chrome-desktop-ui-sea@google.com</owner>
<description>
The user added to the reading list from the Bookmark icon entry point
(Desktop only).
</description>
</action>
<action name="DesktopReadingList.AddItem.FromTabContextMenu">
<owner>corising@chromium.org</owner>
<owner>chrome-desktop-ui-sea@google.com</owner>
<description>
The user added to the reading list from the tab context menu entry point
(Desktop only).
</description>
</action>
<action name="DesktopReadingList.OpenReadingList">
<owner>corising@chromium.org</owner>
<owner>chrome-desktop-ui-sea@google.com</owner>
<description>
The user clicked the Desktop reading list button to open the reading list.
</description>
</action>
<action name="DesktopSearch">
<obsolete>
Deprecated 05/2016 because desktop searches are no longer opened in the
......
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