| Index: chrome/browser/ui/webui/predictors/predictors_dom_handler.cc
|
| diff --git a/chrome/browser/ui/webui/predictors/autocomplete_action_predictor_dom_handler.cc b/chrome/browser/ui/webui/predictors/predictors_dom_handler.cc
|
| similarity index 64%
|
| rename from chrome/browser/ui/webui/predictors/autocomplete_action_predictor_dom_handler.cc
|
| rename to chrome/browser/ui/webui/predictors/predictors_dom_handler.cc
|
| index a7743033acf3775441f37c0a06c00f5028a20446..6f8e88bf49bdcf115c5ea3eb4de7d5f89ad7acb6 100644
|
| --- a/chrome/browser/ui/webui/predictors/autocomplete_action_predictor_dom_handler.cc
|
| +++ b/chrome/browser/ui/webui/predictors/predictors_dom_handler.cc
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "chrome/browser/ui/webui/predictors/autocomplete_action_predictor_dom_handler.h"
|
| +#include "chrome/browser/ui/webui/predictors/predictors_dom_handler.h"
|
|
|
| #include "base/bind.h"
|
| #include "base/values.h"
|
| @@ -11,35 +11,30 @@
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "content/public/browser/web_ui.h"
|
|
|
| -AutocompleteActionPredictorDOMHandler::AutocompleteActionPredictorDOMHandler(
|
| - Profile* profile) {
|
| +PredictorsDOMHandler::PredictorsDOMHandler(Profile* profile) {
|
| autocomplete_action_predictor_ =
|
| - AutocompleteActionPredictorFactory::GetForProfile(profile);
|
| + predictors::AutocompleteActionPredictorFactory::GetForProfile(profile);
|
| }
|
|
|
| -AutocompleteActionPredictorDOMHandler::~AutocompleteActionPredictorDOMHandler()
|
| -{
|
| -}
|
| +PredictorsDOMHandler::~PredictorsDOMHandler() { }
|
|
|
| -void AutocompleteActionPredictorDOMHandler::RegisterMessages() {
|
| +void PredictorsDOMHandler::RegisterMessages() {
|
| web_ui()->RegisterMessageCallback("requestAutocompleteActionPredictorDb",
|
| base::Bind(
|
| - &AutocompleteActionPredictorDOMHandler::
|
| - RequestAutocompleteActionPredictorDb,
|
| + &PredictorsDOMHandler::RequestAutocompleteActionPredictorDb,
|
| base::Unretained(this)));
|
| }
|
|
|
| -void
|
| - AutocompleteActionPredictorDOMHandler::RequestAutocompleteActionPredictorDb(
|
| - const base::ListValue* args) {
|
| +void PredictorsDOMHandler::RequestAutocompleteActionPredictorDb(
|
| + const base::ListValue* args) {
|
| const bool enabled = (autocomplete_action_predictor_ != NULL);
|
| base::DictionaryValue dict;
|
| dict.SetBoolean("enabled", enabled);
|
|
|
| if (enabled) {
|
| base::ListValue* db = new base::ListValue();
|
| - for (AutocompleteActionPredictor::DBCacheMap::const_iterator it =
|
| - autocomplete_action_predictor_->db_cache_.begin();
|
| + for (predictors::AutocompleteActionPredictor::DBCacheMap::const_iterator it
|
| + = autocomplete_action_predictor_->db_cache_.begin();
|
| it != autocomplete_action_predictor_->db_cache_.end();
|
| ++it) {
|
| base::DictionaryValue* entry = new base::DictionaryValue();
|
| @@ -53,7 +48,7 @@ void
|
| }
|
| dict.Set("db", db);
|
| dict.SetDouble("hit_weight",
|
| - AutocompleteActionPredictor::get_hit_weight());
|
| + predictors::AutocompleteActionPredictor::get_hit_weight());
|
| }
|
|
|
| web_ui()->CallJavascriptFunction("updateDatabaseTable", dict);
|
|
|