| Index: chrome/browser/resources/chromeos/chromevox/braille/braille_input_handler.js
|
| diff --git a/chrome/browser/resources/chromeos/chromevox/braille/braille_input_handler.js b/chrome/browser/resources/chromeos/chromevox/braille/braille_input_handler.js
|
| index 2f06fb84db4855fbb89e353374da7f41b36326f5..fcfec6f8bbedd94b98c8bf1a7b9aedd52346442a 100644
|
| --- a/chrome/browser/resources/chromeos/chromevox/braille/braille_input_handler.js
|
| +++ b/chrome/browser/resources/chromeos/chromevox/braille/braille_input_handler.js
|
| @@ -93,8 +93,7 @@ cvox.BrailleInputHandler = function(translatorManager) {
|
| * @const {string}
|
| * @private
|
| */
|
| -cvox.BrailleInputHandler.IME_EXTENSION_ID_ =
|
| - 'jddehjeebkoimngcbdkaahpobgicbffp';
|
| +cvox.BrailleInputHandler.IME_EXTENSION_ID_ = 'jddehjeebkoimngcbdkaahpobgicbffp';
|
|
|
| /**
|
| * Name of the port to use for communicating with the Braille IME.
|
| @@ -175,13 +174,12 @@ cvox.BrailleInputHandler.prototype = {
|
| */
|
| onBrailleKeyEvent: function(event) {
|
| if (event.command === cvox.BrailleKeyCommand.DOTS)
|
| - return this.onBrailleDots_(/** @type {number} */(event.brailleDots));
|
| + return this.onBrailleDots_(/** @type {number} */ (event.brailleDots));
|
| // Any other braille command cancels the pending cells.
|
| this.pendingCells_.length = 0;
|
| if (event.command === cvox.BrailleKeyCommand.STANDARD_KEY) {
|
| - if (event.standardKeyCode === 'Backspace' &&
|
| - !event.altKey && !event.ctrlKey && !event.shiftKey &&
|
| - this.onBackspace_()) {
|
| + if (event.standardKeyCode === 'Backspace' && !event.altKey &&
|
| + !event.ctrlKey && !event.shiftKey && this.onBackspace_()) {
|
| return true;
|
| } else {
|
| this.commitAndClearEntryState_();
|
| @@ -203,7 +201,7 @@ cvox.BrailleInputHandler.prototype = {
|
| return cvox.ExpandingBrailleTranslator.ExpansionType.ALL;
|
| if (this.entryState_ &&
|
| this.entryState_.translator ===
|
| - this.translatorManager_.getDefaultTranslator()) {
|
| + this.translatorManager_.getDefaultTranslator()) {
|
| return cvox.ExpandingBrailleTranslator.ExpansionType.NONE;
|
| }
|
| return cvox.ExpandingBrailleTranslator.ExpansionType.SELECTION;
|
| @@ -348,8 +346,8 @@ cvox.BrailleInputHandler.prototype = {
|
| */
|
| onImeMessage_: function(message) {
|
| if (!goog.isObject(message)) {
|
| - console.error('Unexpected message from Braille IME: ',
|
| - JSON.stringify(message));
|
| + console.error(
|
| + 'Unexpected message from Braille IME: ', JSON.stringify(message));
|
| }
|
| switch (message.type) {
|
| case 'activeState':
|
| @@ -369,17 +367,19 @@ cvox.BrailleInputHandler.prototype = {
|
| // Note that we can't send the backspace key through the
|
| // virtualKeyboardPrivate API in this case because it would then be
|
| // processed by the IME again, leading to an infinite loop.
|
| - this.postImeMessage_(
|
| - {type: 'keyEventHandled', requestId: message['requestId'],
|
| - result: this.onBackspace_()});
|
| + this.postImeMessage_({
|
| + type: 'keyEventHandled',
|
| + requestId: message['requestId'],
|
| + result: this.onBackspace_()
|
| + });
|
| break;
|
| case 'reset':
|
| this.clearEntryState_();
|
| break;
|
| default:
|
| - console.error('Unexpected message from Braille IME: ',
|
| - JSON.stringify(message));
|
| - break;
|
| + console.error(
|
| + 'Unexpected message from Braille IME: ', JSON.stringify(message));
|
| + break;
|
| }
|
| },
|
|
|
| @@ -431,8 +431,7 @@ cvox.BrailleInputHandler.prototype = {
|
| charValue: cvox.BrailleKeyEvent.keyCodeToCharValue(keyName),
|
| // See chrome/common/extensions/api/virtual_keyboard_private.json for
|
| // these constants.
|
| - modifiers: (event.shiftKey ? 2 : 0) |
|
| - (event.ctrlKey ? 4 : 0) |
|
| + modifiers: (event.shiftKey ? 2 : 0) | (event.ctrlKey ? 4 : 0) |
|
| (event.altKey ? 8 : 0)
|
| };
|
| chrome.virtualKeyboardPrivate.sendKeyEvent(keyEvent);
|
| @@ -544,8 +543,7 @@ cvox.BrailleInputHandler.EntryState_.prototype = {
|
| * Makes sure the current text is permanently added to the edit field.
|
| * After this call, this object should be abandoned.
|
| */
|
| - commit: function() {
|
| - },
|
| + commit: function() {},
|
|
|
| /**
|
| * @return {boolean} true if the entry state uses uncommitted cells.
|
| @@ -592,8 +590,7 @@ cvox.BrailleInputHandler.EntryState_.prototype = {
|
| * @param {string} newText Text to send.
|
| * @private
|
| */
|
| - sendTextChange_: function(newText) {
|
| - }
|
| + sendTextChange_: function(newText) {}
|
| };
|
|
|
| /**
|
| @@ -605,8 +602,7 @@ cvox.BrailleInputHandler.EntryState_.prototype = {
|
| * @extends {cvox.BrailleInputHandler.EntryState_}
|
| * @private
|
| */
|
| -cvox.BrailleInputHandler.EditsEntryState_ = function(
|
| - inputHandler, translator) {
|
| +cvox.BrailleInputHandler.EditsEntryState_ = function(inputHandler, translator) {
|
| cvox.BrailleInputHandler.EntryState_.call(this, inputHandler, translator);
|
| };
|
|
|
| @@ -617,8 +613,8 @@ cvox.BrailleInputHandler.EditsEntryState_.prototype = {
|
| sendTextChange_: function(newText) {
|
| var oldText = this.text_;
|
| // Find the common prefix of the old and new text.
|
| - var commonPrefixLength = StringUtil.longestCommonPrefixLength(
|
| - oldText, newText);
|
| + var commonPrefixLength =
|
| + StringUtil.longestCommonPrefixLength(oldText, newText);
|
| // How many characters we need to delete from the existing text to replace
|
| // them with characters from the new text.
|
| var deleteLength = oldText.length - commonPrefixLength;
|
| @@ -640,11 +636,12 @@ cvox.BrailleInputHandler.EditsEntryState_.prototype = {
|
| this.pendingTextsBefore_.push(textBeforeAfterDelete + toInsert);
|
| }
|
| // Send the replace operation to be performed asynchronously by the IME.
|
| - this.inputHandler_.postImeMessage_(
|
| - {type: 'replaceText',
|
| - contextID: this.inputHandler_.inputContext_.contextID,
|
| - deleteBefore: deleteLength,
|
| - newText: toInsert});
|
| + this.inputHandler_.postImeMessage_({
|
| + type: 'replaceText',
|
| + contextID: this.inputHandler_.inputContext_.contextID,
|
| + deleteBefore: deleteLength,
|
| + newText: toInsert
|
| + });
|
| }
|
| }
|
| };
|
| @@ -669,9 +666,10 @@ cvox.BrailleInputHandler.LateCommitEntryState_.prototype = {
|
|
|
| /** @override */
|
| commit: function() {
|
| - this.inputHandler_.postImeMessage_(
|
| - {type: 'commitUncommitted',
|
| - contextID: this.inputHandler_.inputContext_.contextID});
|
| + this.inputHandler_.postImeMessage_({
|
| + type: 'commitUncommitted',
|
| + contextID: this.inputHandler_.inputContext_.contextID
|
| + });
|
| },
|
|
|
| /** @override */
|
| @@ -681,9 +679,10 @@ cvox.BrailleInputHandler.LateCommitEntryState_.prototype = {
|
|
|
| /** @override */
|
| sendTextChange_: function(newText) {
|
| - this.inputHandler_.postImeMessage_(
|
| - {type: 'setUncommitted',
|
| - contextID: this.inputHandler_.inputContext_.contextID,
|
| - text: newText});
|
| + this.inputHandler_.postImeMessage_({
|
| + type: 'setUncommitted',
|
| + contextID: this.inputHandler_.inputContext_.contextID,
|
| + text: newText
|
| + });
|
| }
|
| };
|
|
|