| Index: third_party/google_input_tools/src/chrome/os/inputview/featuretracker.js
|
| diff --git a/third_party/google_input_tools/src/chrome/os/inputview/featuretracker.js b/third_party/google_input_tools/src/chrome/os/inputview/featuretracker.js
|
| deleted file mode 100644
|
| index ea35c87caec87b58628caa5d82a43ba57b0f123b..0000000000000000000000000000000000000000
|
| --- a/third_party/google_input_tools/src/chrome/os/inputview/featuretracker.js
|
| +++ /dev/null
|
| @@ -1,103 +0,0 @@
|
| -// Copyright 2015 The ChromeOS IME Authors. All Rights Reserved.
|
| -// limitations under the License.
|
| -// See the License for the specific language governing permissions and
|
| -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| -// distributed under the License is distributed on an "AS-IS" BASIS,
|
| -// Unless required by applicable law or agreed to in writing, software
|
| -//
|
| -// http://www.apache.org/licenses/LICENSE-2.0
|
| -//
|
| -// You may obtain a copy of the License at
|
| -// you may not use this file except in compliance with the License.
|
| -// Licensed under the Apache License, Version 2.0 (the "License");
|
| -//
|
| -goog.provide('i18n.input.chrome.inputview.FeatureTracker');
|
| -
|
| -goog.require('goog.object');
|
| -goog.require('i18n.input.chrome.inputview.FeatureName');
|
| -
|
| -goog.scope(function() {
|
| -var FeatureName = i18n.input.chrome.inputview.FeatureName;
|
| -
|
| -
|
| -/**
|
| - * Controller for experimental features.
|
| - *
|
| - * @constructor
|
| - */
|
| -i18n.input.chrome.inputview.FeatureTracker = function() {
|
| -
|
| - /**
|
| - * Whether experimental flags is enabled.
|
| - *
|
| - * @private {Object.<string, boolean>}
|
| - */
|
| - this.features_ = {};
|
| -
|
| - /**
|
| - * Features that are enabled by default. Any feature not on this list is
|
| - * disabled unless the runtime --enable-inputview-{feature} flag is present.
|
| - *
|
| - * @const
|
| - * @private {!Array<FeatureName>}
|
| - */
|
| - this.ENABLED_BY_DEFAULT_ = [];
|
| -
|
| - /**
|
| - * Whether the features list is ready.
|
| - *
|
| - * @private {boolean}
|
| - */
|
| - this.ready_ = false;
|
| -};
|
| -
|
| -var FeatureTracker = i18n.input.chrome.inputview.FeatureTracker;
|
| -
|
| -
|
| -/**
|
| - * Whether the feature is enabled.
|
| - *
|
| - * @param {!FeatureName} feature .
|
| - * @return {boolean}
|
| - */
|
| -FeatureTracker.prototype.isEnabled = function(feature) {
|
| - if (!this.ready_) {
|
| - console.error('Features not present in config or not ready yet.');
|
| - }
|
| - if (feature in this.features_) {
|
| - return this.features_[feature];
|
| - }
|
| - return (this.ENABLED_BY_DEFAULT_.indexOf(feature) >= 0) ||
|
| - !!this.features_[FeatureName.EXPERIMENTAL];
|
| -};
|
| -
|
| -
|
| -/**
|
| - * Inits the feature tracker.
|
| - *
|
| - * @param {!Object} config The keyboard config.
|
| - */
|
| -FeatureTracker.prototype.initialize = function(config) {
|
| - if (config.features) {
|
| - var features = config.features;
|
| - // Parse the run time flags.
|
| - for (var i = 0; i < features.length; i++) {
|
| - var pieces = features[i].split('-');
|
| - var state = pieces.pop();
|
| - if (state == 'enabled') {
|
| - this.features_[pieces.join('-')] = true;
|
| - } else if (state == 'disabled') {
|
| - this.features_[pieces.join('-')] = false;
|
| - } else {
|
| - console.error('Unrecognized flag: ' + features[i]);
|
| - }
|
| - }
|
| - this.ready_ = true;
|
| - } else {
|
| - console.error('API Error. Features not present in config.');
|
| - return;
|
| - }
|
| -};
|
| -
|
| -}); // goog.scope
|
| -
|
|
|