Commit 778f6f32 authored by Dana Fried's avatar Dana Fried Committed by Commit Bot

Record open bookmarks via middle-click.

Affects folders in the bookmark folder as well as subfolders.

We could also log this at the event source using the existing
BookmarkBar_ContextMenu_OpenAll event, but since it's a click/gesture
rather than a context menu action I created a new event type for it.

Bug: 954254
Change-Id: I4ae18d9f2dbdda5448fdc3993e06b6ef76159570
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1574147
Commit-Queue: Dana Fried <dfried@chromium.org>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Reviewed-by: default avatarMark Pearson <mpearson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#652610}
parent 651a5c3b
......@@ -50,6 +50,15 @@ void RecordBookmarkLaunch(const BookmarkNode* node,
RecordNodeDepth(node);
}
void RecordBookmarkFolderLaunch(const BookmarkNode* node,
BookmarkLaunchLocation location) {
if (IsBookmarkBarLocation(location))
base::RecordAction(
base::UserMetricsAction("MiddleClickedBookmarkBarFolder"));
RecordNodeDepth(node);
}
void RecordBookmarkFolderOpen(BookmarkLaunchLocation location) {
if (IsBookmarkBarLocation(location))
base::RecordAction(base::UserMetricsAction("ClickedBookmarkBarFolder"));
......
......@@ -45,6 +45,11 @@ enum BookmarkLaunchLocation {
void RecordBookmarkLaunch(const bookmarks::BookmarkNode* node,
BookmarkLaunchLocation location);
// Records the user launching all bookmarks in a folder (via middle-click, etc.)
// for UMA purposes.
void RecordBookmarkFolderLaunch(const bookmarks::BookmarkNode* node,
BookmarkLaunchLocation location);
// Records the user opening a folder of bookmarks for UMA purposes.
void RecordBookmarkFolderOpen(BookmarkLaunchLocation location);
......
......@@ -1354,6 +1354,7 @@ void BookmarkBarView::OnMenuButtonClicked(views::Button* view,
(event->flags() & ui::EF_PLATFORM_ACCELERATOR))) {
WindowOpenDisposition disposition_from_event_flags =
ui::DispositionFromEventFlags(event->flags());
RecordBookmarkFolderLaunch(node, GetBookmarkLaunchLocation());
chrome::OpenAll(GetWidget()->GetNativeWindow(), page_navigator_, node,
disposition_from_event_flags, browser_->profile());
} else {
......@@ -1391,7 +1392,6 @@ void BookmarkBarView::ButtonPressed(views::Button* sender,
OpenURLParams params(node->url(), Referrer(), disposition_from_event_flags,
ui::PAGE_TRANSITION_AUTO_BOOKMARK, false);
page_navigator_->OpenURL(params);
RecordBookmarkLaunch(node, GetBookmarkLaunchLocation());
}
......
......@@ -10984,6 +10984,15 @@ 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="MiddleClickedBookmarkBarFolder">
<owner>dfried@chromium.org</owner>
<description>
Triggered when user middle-clicks a bookmarks bar folder, resulting in all
bookmarks in the folder being opened. Applies to all folders reachable from
the bookmark bar, including subfolders and overflow.
</description>
</action>
<action name="MinButton_Clk">
<owner>Please list the metric's owners. Add more owner tags as needed.</owner>
<description>Please enter the description of this user action.</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