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

Unified Diff: third_party/google_input_tools/src/chrome/os/statistics.js

Issue 1257313003: Update Google Input Tools (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Free up grd resources. Created 5 years, 5 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: third_party/google_input_tools/src/chrome/os/statistics.js
diff --git a/third_party/google_input_tools/src/chrome/os/statistics.js b/third_party/google_input_tools/src/chrome/os/statistics.js
index 693e18979b7f27ea428e316dfc06a1a89831619f..2ec93aa8e2794d2f3585c564d702934bfef0e409 100644
--- a/third_party/google_input_tools/src/chrome/os/statistics.js
+++ b/third_party/google_input_tools/src/chrome/os/statistics.js
@@ -231,37 +231,39 @@ Statistics.prototype.recordCommit = function(
if (!this.inputMethodId_) {
return;
}
- var length = target.length;
- // Increment to include space.
- if (triggerType == TriggerType.RESET) {
- length++;
- } else if (triggerType == TriggerType.REVERT) {
- length -= this.lastCommitLength_;
- }
- this.lastCommitLength_ = length;
- this.charactersCommitted_ += length;
-
var CommitTypes = Statistics.CommitTypes;
var commitType = -1;
- if (targetIndex == 0 && source == target) {
- commitType = CommitTypes.X_X0;
- } else if (targetIndex == 0 && source != target) {
- commitType = CommitTypes.X_Y0;
- } else if (targetIndex == 1 && source == target) {
- commitType = CommitTypes.X_X1;
- } else if (targetIndex == 1 && source != target) {
- commitType = CommitTypes.X_Y1;
- } else if (targetIndex > 1 && source == target) {
- commitType = CommitTypes.X_X2;
- } else if (targetIndex > 1 && source != target) {
- commitType = CommitTypes.X_Y2;
- } else if (!source && source != target) {
- commitType = CommitTypes.PREDICTION;
- } else if (triggerType == TriggerType.REVERT) {
+ var length = target.length;
+
+ if (triggerType == TriggerType.REVERT) {
+ length -= this.lastCommitLength_;
commitType = CommitTypes.REVERT;
} else if (triggerType == TriggerType.VOICE) {
commitType = CommitTypes.VOICE;
+ } else if (triggerType == TriggerType.RESET) {
+ // Increment to include space.
+ length++;
+ } else if (triggerType == TriggerType.CANDIDATE ||
+ triggerType == TriggerType.SPACE) {
+ if (!source && target) {
+ commitType = CommitTypes.PREDICTION;
+ } else if (targetIndex == 0 && source == target) {
+ commitType = CommitTypes.X_X0;
+ } else if (targetIndex == 0 && source != target) {
+ commitType = CommitTypes.X_Y0;
+ } else if (targetIndex == 1 && source == target) {
+ commitType = CommitTypes.X_X1;
+ } else if (targetIndex == 1 && source != target) {
+ commitType = CommitTypes.X_Y1;
+ } else if (targetIndex > 1 && source == target) {
+ commitType = CommitTypes.X_X2;
+ } else if (targetIndex > 1 && source != target) {
+ commitType = CommitTypes.X_Y2;
+ }
}
+ this.lastCommitLength_ = length;
+ this.charactersCommitted_ += length;
+
if (commitType < 0) {
return;
}

Powered by Google App Engine
This is Rietveld 408576698