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

Unified Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/command_handler.js

Issue 2495373005: Record ChromeVox metrics (Closed)
Patch Set: Rename 'Accessibility.' and clarify Next Created 4 years, 1 month 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/resources/chromeos/chromevox/cvox2/background/command_handler.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/command_handler.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/command_handler.js
index b87ad1267bb4d737f39927558988abe8539f6324..9f70869aa418c9a578c65ffd9e8add53461ed4f0 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/command_handler.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/command_handler.js
@@ -210,27 +210,34 @@ CommandHandler.onCommand = function(command) {
var rootPred = AutomationPredicate.root;
var speechProps = {};
var skipSync = false;
+ var didNavigate = false;
switch (command) {
case 'nextCharacter':
+ didNavigate = true;
speechProps['phoneticCharacters'] = true;
current = current.move(cursors.Unit.CHARACTER, Dir.FORWARD);
break;
case 'previousCharacter':
+ didNavigate = true;
speechProps['phoneticCharacters'] = true;
current = current.move(cursors.Unit.CHARACTER, Dir.BACKWARD);
break;
case 'nextWord':
+ didNavigate = true;
current = current.move(cursors.Unit.WORD, Dir.FORWARD);
break;
case 'previousWord':
+ didNavigate = true;
current = current.move(cursors.Unit.WORD, Dir.BACKWARD);
break;
case 'forward':
case 'nextLine':
+ didNavigate = true;
current = current.move(cursors.Unit.LINE, Dir.FORWARD);
break;
case 'backward':
case 'previousLine':
+ didNavigate = true;
current = current.move(cursors.Unit.LINE, Dir.BACKWARD);
break;
case 'nextButton':
@@ -405,10 +412,12 @@ CommandHandler.onCommand = function(command) {
break;
case 'right':
case 'nextObject':
+ didNavigate = true;
current = current.move(cursors.Unit.NODE, Dir.FORWARD);
break;
case 'left':
case 'previousObject':
+ didNavigate = true;
current = current.move(cursors.Unit.NODE, Dir.BACKWARD);
break;
case 'previousGroup':
@@ -663,7 +672,12 @@ CommandHandler.onCommand = function(command) {
return true;
}
+ if (didNavigate)
+ chrome.metricsPrivate.recordUserAction('Accessibility.ChromeVox.Navigate');
+
if (pred) {
+ chrome.metricsPrivate.recordUserAction('Accessibility.ChromeVox.Jump');
+
var bound = current.getBound(dir).node;
if (bound) {
var node = AutomationUtil.findNextNode(

Powered by Google App Engine
This is Rietveld 408576698