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 59d3761db7357b4ee1fcebcbb7c8b976872bea62..551f96ef474f4b8ebab69043683361df465c7f31 100644 |
--- a/third_party/google_input_tools/src/chrome/os/statistics.js |
+++ b/third_party/google_input_tools/src/chrome/os/statistics.js |
@@ -80,6 +80,24 @@ Statistics.prototype.autoCorrectLevel_ = 0; |
/** |
+ * Whether recording for physical keyboard specially. |
+ * |
+ * @private {boolean} |
+ */ |
+Statistics.prototype.isPhysicalKeyboard_ = false; |
+ |
+ |
+/** |
+ * Sets whether recording for physical keyboard. |
+ * |
+ * @param {boolean} isPhysicalKeyboard . |
+ */ |
+Statistics.prototype.setPhysicalKeyboard = function(isPhysicalKeyboard) { |
+ this.isPhysicalKeyboard_ = isPhysicalKeyboard; |
+}; |
+ |
+ |
+/** |
* Sets the current input method id. |
* |
* @param {string} inputMethodId . |
@@ -160,12 +178,15 @@ Statistics.prototype.recordCommit = function( |
return; |
} |
+ // For latin transliteration, record the logs under the name with 'Pk' which |
+ // means Physical Keyboard. |
+ var name = this.isPhysicalKeyboard_ ? |
+ 'InputMethod.PkCommit.' : 'InputMethod.Commit.'; |
+ |
var self = this; |
var record = function(suffix) { |
- self.recordEnum('InputMethod.Commit.Index' + suffix, |
- targetIndex + 1, 20); |
- self.recordEnum('InputMethod.Commit.Type' + suffix, |
- commitType, CommitTypes.MAX); |
+ self.recordEnum(name + 'Index' + suffix, targetIndex + 1, 20); |
+ self.recordEnum(name + 'Type' + suffix, commitType, CommitTypes.MAX); |
}; |
record(''); |