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

Unified Diff: third_party/google_input_tools/src/chrome/os/inputview/featuretracker.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/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
index 22a4a9e47e44aac635cdb8f38d1575dae2966f59..ea35c87caec87b58628caa5d82a43ba57b0f123b 100644
--- a/third_party/google_input_tools/src/chrome/os/inputview/featuretracker.js
+++ b/third_party/google_input_tools/src/chrome/os/inputview/featuretracker.js
@@ -17,7 +17,6 @@ goog.require('goog.object');
goog.require('i18n.input.chrome.inputview.FeatureName');
goog.scope(function() {
-var Adapter = i18n.input.chrome.inputview.Adapter;
var FeatureName = i18n.input.chrome.inputview.FeatureName;
@@ -43,6 +42,13 @@ i18n.input.chrome.inputview.FeatureTracker = function() {
* @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;
@@ -55,6 +61,9 @@ var FeatureTracker = i18n.input.chrome.inputview.FeatureTracker;
* @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];
}
@@ -83,6 +92,7 @@ FeatureTracker.prototype.initialize = function(config) {
console.error('Unrecognized flag: ' + features[i]);
}
}
+ this.ready_ = true;
} else {
console.error('API Error. Features not present in config.');
return;

Powered by Google App Engine
This is Rietveld 408576698