Chromium Code Reviews| 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..46c35cb70a0f15b2925abffdf1293d56677087fa 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 |
| @@ -8,6 +8,7 @@ |
| #include <vector> |
| #include "ash/accelerators/accelerator_controller.h" |
| +#include "ash/metrics/voice_interaction_metrics.h" |
| #include "ash/public/cpp/shell_window_ids.h" |
| #include "ash/shell.h" |
| #include "base/bind.h" |
| @@ -15,6 +16,7 @@ |
| #include "base/containers/flat_set.h" |
| #include "base/logging.h" |
| #include "base/memory/ref_counted.h" |
| +#include "base/metrics/histogram_macros.h" |
| #include "base/task_scheduler/post_task.h" |
| #include "chrome/browser/ui/browser.h" |
| #include "chrome/browser/ui/browser_list.h" |
| @@ -122,6 +124,27 @@ void EncodeAndReturnImage( |
| callback); |
| } |
| +void RecordAcceleratorUmaMetrics(const ui::Accelerator& accelerator) { |
| + if (accelerator.IsCmdDown() && accelerator.key_code() == ui::VKEY_A) { |
| + if (accelerator.IsShiftDown()) { |
| + UMA_HISTOGRAM_ENUMERATION( |
| + "VoiceInteraction.MetaLayer.EntryPoints", |
| + ash::VoiceInteractionMetaLayerEntry::META_SHIFT_A, |
|
Daniel Erat
2017/05/23 22:32:18
does "meta" here correspond to the search key? if
Muyuan
2017/05/24 00:24:54
Acknowledged.
|
| + ash::VoiceInteractionMetaLayerEntry::COUNT); |
| + return; |
| + } |
| + UMA_HISTOGRAM_ENUMERATION("VoiceInteraction.EntryPoints", |
| + ash::VoiceInteractionEntry::META_A, |
| + ash::VoiceInteractionEntry::COUNT); |
| + return; |
| + } |
| + if (accelerator.IsCmdDown() && accelerator.key_code() == ui::VKEY_SPACE) { |
| + UMA_HISTOGRAM_ENUMERATION("VoiceInteraction.EntryPoints", |
| + ash::VoiceInteractionEntry::META_SPACE, |
| + ash::VoiceInteractionEntry::COUNT); |
| + } |
| +} |
| + |
| } // namespace |
| // static |
| @@ -171,6 +194,8 @@ bool ArcVoiceInteractionFrameworkService::AcceleratorPressed( |
| const ui::Accelerator& accelerator) { |
| DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| + RecordAcceleratorUmaMetrics(accelerator); |
| + |
| if (accelerator.IsShiftDown()) { |
| // Temporary, used for debugging. |
| // Does not take into account or update the palette state. |