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

Unified Diff: chrome/browser/resources/predictors/predictors.js

Issue 9610006: Refactoring, moving and renaming the NetworkActionPredictor. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressing Dominic's comments. Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/predictors/predictors.js
diff --git a/chrome/browser/resources/network_action_predictor/network_action_predictor.js b/chrome/browser/resources/predictors/predictors.js
similarity index 74%
rename from chrome/browser/resources/network_action_predictor/network_action_predictor.js
rename to chrome/browser/resources/predictors/predictors.js
index 11343cb9dd65c7ac4e10aeafe53e7e3091320710..840ab5878dc3dff192f9f990751b1547fdefe357 100644
--- a/chrome/browser/resources/network_action_predictor/network_action_predictor.js
+++ b/chrome/browser/resources/predictors/predictors.js
@@ -5,16 +5,16 @@
/**
* Requests the database from the backend.
*/
-function requestNetworkActionPredictorDb() {
+function requestAutocompleteActionPredictorDb() {
console.debug('Requesting NAP DB');
- chrome.send('requestNetworkActionPredictorDb', [])
+ chrome.send('requestAutocompleteActionPredictorDb', [])
}
/**
* Callback from backend with the database contents. Sets up some globals and
* calls to create the UI.
- * @param {Dictionary} database Information about NetworkActionPredictor
+ * @param {Dictionary} database Information about AutocompleteActionPredictor
* including the database as a flattened list, a boolean indicating if the
* system is enabled and the current hit weight.
*/
@@ -32,18 +32,19 @@ function updateDatabaseTable(database) {
/**
* Updates the table from the database.
- * @param {Dictionary} database Information about NetworkActionPredictor
+ * @param {Dictionary} database Information about AutocompleteActionPredictor
* including the database as a flattened list, a boolean indicating if the
* system is enabled and the current hit weight.
*/
function updateDatabaseView(database) {
var databaseSection = $('databaseTableBody');
- var showEnabled = database.enabled && database.db;
+ var autocompletePredictorEnabled = database.autocompletePredictorEnabled &&
+ database.db;
- $('enabledMode').hidden = !showEnabled;
- $('disabledMode').hidden = showEnabled;
+ $('autocompletePredictorEnabledMode').hidden = !autocompletePredictorEnabled;
+ $('autocompletePredictorDisabledMode').hidden = autocompletePredictorEnabled;
- if (!showEnabled)
+ if (!autocompletePredictorEnabled)
return;
var filter = $('filter');
@@ -74,4 +75,5 @@ function updateDatabaseView(database) {
$('countBanner').textContent += ' Hit Weight: ' + database.hit_weight;
}
-document.addEventListener('DOMContentLoaded', requestNetworkActionPredictorDb);
+document.addEventListener('DOMContentLoaded',
+ requestAutocompleteActionPredictorDb);

Powered by Google App Engine
This is Rietveld 408576698