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

Side by Side Diff: third_party/google_input_tools/src/chrome/os/inputview/adapter.js

Issue 975453003: Update Google Input Tools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The ChromeOS IME Authors. All Rights Reserved. 1 // Copyright 2014 The ChromeOS IME Authors. All Rights Reserved.
2 // limitations under the License. 2 // limitations under the License.
3 // See the License for the specific language governing permissions and 3 // See the License for the specific language governing permissions and
4 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5 // distributed under the License is distributed on an "AS-IS" BASIS, 5 // distributed under the License is distributed on an "AS-IS" BASIS,
6 // Unless required by applicable law or agreed to in writing, software 6 // Unless required by applicable law or agreed to in writing, software
7 // 7 //
8 // http://www.apache.org/licenses/LICENSE-2.0 8 // http://www.apache.org/licenses/LICENSE-2.0
9 // 9 //
10 // You may obtain a copy of the License at 10 // You may obtain a copy of the License at
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // TODO: Add support for spreadsheets. 110 // TODO: Add support for spreadsheets.
111 DOCS: 'https://docs.google.com/document/d' 111 DOCS: 'https://docs.google.com/document/d'
112 }; 112 };
113 113
114 114
115 /** @type {boolean} */ 115 /** @type {boolean} */
116 Adapter.prototype.isA11yMode = false; 116 Adapter.prototype.isA11yMode = false;
117 117
118 118
119 /** @type {boolean} */ 119 /** @type {boolean} */
120 Adapter.prototype.isExperimental = false;
121
122
123 /** @type {boolean} */
124 Adapter.prototype.isVoiceInputEnabled = true; 120 Adapter.prototype.isVoiceInputEnabled = true;
125 121
126 122
127 /** @type {boolean} */ 123 /** @type {boolean} */
128 Adapter.prototype.showGlobeKey = false; 124 Adapter.prototype.showGlobeKey = false;
129 125
130 126
131 /** @type {string} */ 127 /** @type {string} */
132 Adapter.prototype.contextType = ContextType.DEFAULT; 128 Adapter.prototype.contextType = ContextType.DEFAULT;
133 129
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 375
380 /** 376 /**
381 * True to enable gesture typing. 377 * True to enable gesture typing.
382 * 378 *
383 * @return {boolean} 379 * @return {boolean}
384 */ 380 */
385 Adapter.prototype.isGestureTypingEnabled = function() { 381 Adapter.prototype.isGestureTypingEnabled = function() {
386 return this.features.isEnabled(FeatureName.GESTURE_TYPING); 382 return this.features.isEnabled(FeatureName.GESTURE_TYPING);
387 }; 383 };
388 384
385
389 /** 386 /**
390 * Callback when blurs in the context. 387 * Callback when blurs in the context.
391 * 388 *
392 * @private 389 * @private
393 */ 390 */
394 Adapter.prototype.onContextBlur_ = function() { 391 Adapter.prototype.onContextBlur_ = function() {
395 this.contextType = ''; 392 this.contextType = '';
396 this.dispatchEvent(new goog.events.Event(i18n.input.chrome.inputview.events. 393 this.dispatchEvent(new goog.events.Event(i18n.input.chrome.inputview.events.
397 EventType.CONTEXT_BLUR)); 394 EventType.CONTEXT_BLUR));
398 }; 395 };
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 this.isChromeVoxOn = details['value']; 485 this.isChromeVoxOn = details['value'];
489 }).bind(this)); 486 }).bind(this));
490 } 487 }
491 488
492 this.initBackground_(); 489 this.initBackground_();
493 490
494 var StateType = i18n.input.chrome.inputview.ReadyState.StateType; 491 var StateType = i18n.input.chrome.inputview.ReadyState.StateType;
495 if (window.inputview) { 492 if (window.inputview) {
496 inputview.getKeyboardConfig((function(config) { 493 inputview.getKeyboardConfig((function(config) {
497 this.isA11yMode = !!config['a11ymode']; 494 this.isA11yMode = !!config['a11ymode'];
498 this.isExperimental = !!config['experimental'];
499 this.features.initialize(config); 495 this.features.initialize(config);
500 this.readyState_.markStateReady(StateType.KEYBOARD_CONFIG_READY); 496 this.readyState_.markStateReady(StateType.KEYBOARD_CONFIG_READY);
501 this.maybeDispatchSettingsReadyEvent_(); 497 this.maybeDispatchSettingsReadyEvent_();
502 }).bind(this)); 498 }).bind(this));
503 inputview.getInputMethods((function(inputMethods) { 499 inputview.getInputMethods((function(inputMethods) {
504 // Only show globe key to switching between IMEs when there are more 500 // Only show globe key to switching between IMEs when there are more
505 // than one IME. 501 // than one IME.
506 this.showGlobeKey = inputMethods.length > 1; 502 this.showGlobeKey = inputMethods.length > 1;
507 this.readyState_.markStateReady(StateType.IME_LIST_READY); 503 this.readyState_.markStateReady(StateType.IME_LIST_READY);
508 this.maybeDispatchSettingsReadyEvent_(); 504 this.maybeDispatchSettingsReadyEvent_();
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 * 595 *
600 * @private 596 * @private
601 */ 597 */
602 Adapter.prototype.onVisibilityChange_ = function() { 598 Adapter.prototype.onVisibilityChange_ = function() {
603 this.isVisible = !document.webkitHidden; 599 this.isVisible = !document.webkitHidden;
604 this.dispatchEvent(new goog.events.Event(i18n.input.chrome.inputview. 600 this.dispatchEvent(new goog.events.Event(i18n.input.chrome.inputview.
605 events.EventType.VISIBILITY_CHANGE)); 601 events.EventType.VISIBILITY_CHANGE));
606 chrome.runtime.sendMessage(goog.object.create( 602 chrome.runtime.sendMessage(goog.object.create(
607 Name.TYPE, Type.VISIBILITY_CHANGE, 603 Name.TYPE, Type.VISIBILITY_CHANGE,
608 Name.VISIBILITY, !document.webkitHidden, 604 Name.VISIBILITY, !document.webkitHidden,
609 Name.IS_EXPERIMENTAL, this.isExperimental,
610 Name.WORKSPACE_HEIGHT, screen.height - window.innerHeight)); 605 Name.WORKSPACE_HEIGHT, screen.height - window.innerHeight));
611 }; 606 };
612 607
613 608
614 /** 609 /**
615 * Sends request for completion. 610 * Sends request for completion.
616 * 611 *
617 * @param {string} query . 612 * @param {string} query .
618 * @param {!Object=} opt_spatialData . 613 * @param {!Object=} opt_spatialData .
619 */ 614 */
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 * Unset the inputtool 796 * Unset the inputtool
802 */ 797 */
803 Adapter.prototype.unsetController = function() { 798 Adapter.prototype.unsetController = function() {
804 chrome.runtime.sendMessage( 799 chrome.runtime.sendMessage(
805 goog.object.create( 800 goog.object.create(
806 Name.TYPE, 801 Name.TYPE,
807 Type.UNSET_CONTROLLER)); 802 Type.UNSET_CONTROLLER));
808 }; 803 };
809 }); // goog.scope 804 }); // goog.scope
810 805
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698