Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3260)

Unified Diff: chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.cc

Issue 2900913002: add UMA metrics for voice interaction entries. (Closed)
Patch Set: change to log user action instead. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.cc
diff --git a/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.cc b/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.cc
index 97f746f60fc83e28d20ef544598de70092f3d14e..8a2455ddee54995ca5c36eeae016d5b8f7c8bf38 100644
--- a/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.cc
+++ b/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.cc
@@ -15,6 +15,8 @@
#include "base/containers/flat_set.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
+#include "base/metrics/user_metrics.h"
+#include "base/metrics/user_metrics_action.h"
#include "base/task_scheduler/post_task.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
@@ -122,6 +124,24 @@ void EncodeAndReturnImage(
callback);
}
+void RecordShortcutAction(const ui::Accelerator& accelerator) {
+ if (accelerator.IsCmdDown() && accelerator.key_code() == ui::VKEY_A) {
+ if (accelerator.IsShiftDown()) {
+ base::RecordAction(base::UserMetricsAction(
+ "VoiceInteraction.MetaLayerEntry.Search_Shift_A"));
Daniel Erat 2017/05/24 13:07:55 oh, i thought "meta" was referring to the meta key
Muyuan 2017/05/24 17:48:57 Done.
+ return;
+ }
+ base::RecordAction(
+ base::UserMetricsAction("VoiceInteraction.Entry.Search_A"));
+ return;
+ }
+
+ if (accelerator.IsCmdDown() && accelerator.key_code() == ui::VKEY_SPACE) {
+ base::RecordAction(
+ base::UserMetricsAction("VoiceInteraction.Entry.Search_Space"));
Daniel Erat 2017/05/24 13:07:55 return here to match the rest of the method and to
Muyuan 2017/05/24 17:48:57 Done.
+ }
+}
+
} // namespace
// static
@@ -171,6 +191,8 @@ bool ArcVoiceInteractionFrameworkService::AcceleratorPressed(
const ui::Accelerator& accelerator) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ RecordShortcutAction(accelerator);
+
if (accelerator.IsShiftDown()) {
// Temporary, used for debugging.
// Does not take into account or update the palette state.

Powered by Google App Engine
This is Rietveld 408576698