Skip to content

Commit b253b2d

Browse files
author
wutao
committed
M66 merge: cros: Add user actions to KSV.
This cl adds two user actions to Keyboard Shortcut Viewer (KSV): 1. The times user creates a new window of Keyboard Shortcut Viewer. 2. The times user enters search mode in Keyboard Shortcut Viewer. [email protected],[email protected] Bug: 768932 Test: can see the counts in chrome://user-actions. Change-Id: Id04f20c755def88f6f360d3c66ac1417180d5a94 Reviewed-on: https://chromium-review.googlesource.com/938381 Reviewed-by: Ahmed Fakhry <[email protected]> Reviewed-by: Steven Holte <[email protected]> Commit-Queue: Tao Wu <[email protected]> Cr-Original-Commit-Position: refs/heads/master@{#540300}(cherry picked from commit fdbb173) Reviewed-on: https://chromium-review.googlesource.com/953029 Reviewed-by: Tao Wu <[email protected]> Cr-Commit-Position: refs/branch-heads/3359@{#62} Cr-Branched-From: 66afc5e-refs/heads/master@{#540276}
1 parent 29c63f1 commit b253b2d

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

ash/components/shortcut_viewer/views/keyboard_shortcut_view.cc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#include "ash/public/cpp/shelf_item.h"
1717
#include "ash/public/cpp/window_properties.h"
1818
#include "base/i18n/string_search.h"
19+
#include "base/metrics/user_metrics.h"
20+
#include "base/metrics/user_metrics_action.h"
1921
#include "ui/aura/client/aura_constants.h"
2022
#include "ui/aura/window.h"
2123
#include "ui/base/default_style.h"
@@ -95,6 +97,9 @@ views::Widget* KeyboardShortcutView::Show(gfx::NativeWindow context) {
9597
// it.
9698
g_ksv_view->GetWidget()->Activate();
9799
} else {
100+
base::RecordAction(
101+
base::UserMetricsAction("KeyboardShortcutViewer.CreateWindow"));
102+
98103
constexpr gfx::Size kKSVWindowSize(768, 512);
99104
gfx::Rect window_bounds(kKSVWindowSize);
100105
if (context) {
@@ -348,7 +353,10 @@ void KeyboardShortcutView::ActiveChanged(
348353
sender->ShowBackOrGoogleIcon(is_active);
349354
search_results_container_->SetVisible(is_active);
350355
tabbed_pane_->SetVisible(!is_active);
351-
if (!is_active) {
356+
if (is_active) {
357+
base::RecordAction(
358+
base::UserMetricsAction("KeyboardShortcutViewer.Search"));
359+
} else {
352360
search_results_container_->RemoveAllChildViews(true);
353361
RequestFocusForActiveTab();
354362
}

tools/metrics/actions/actions.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8263,6 +8263,20 @@ should be able to be added at any place in this file.
82638263
<description>Please enter the description of this user action.</description>
82648264
</action>
82658265

8266+
<action name="KeyboardShortcutViewer.CreateWindow">
8267+
<owner>[email protected]</owner>
8268+
<description>
8269+
Records when the user creates a new window of Keyboard Shortcut Viewer.
8270+
</description>
8271+
</action>
8272+
8273+
<action name="KeyboardShortcutViewer.Search">
8274+
<owner>[email protected]</owner>
8275+
<description>
8276+
Records when the user enters search mode in Keyboard Shortcut Viewer.
8277+
</description>
8278+
</action>
8279+
82668280
<action name="KeywordEditor_AddKeyword">
82678281
<owner>Please list the metric's owners. Add more owner tags as needed.</owner>
82688282
<description>Please enter the description of this user action.</description>

0 commit comments

Comments
 (0)