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

Unified Diff: chrome/browser/ui/webui/predictors/predictors_handler.cc

Issue 10380041: Refactoring AutocompleteActionPredictor Database. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Syncing to HEAD Created 8 years, 7 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/ui/webui/predictors/predictors_handler.cc
diff --git a/chrome/browser/ui/webui/predictors/autocomplete_action_predictor_dom_handler.cc b/chrome/browser/ui/webui/predictors/predictors_handler.cc
similarity index 66%
rename from chrome/browser/ui/webui/predictors/autocomplete_action_predictor_dom_handler.cc
rename to chrome/browser/ui/webui/predictors/predictors_handler.cc
index a7743033acf3775441f37c0a06c00f5028a20446..173e7a83eb1339ef741ed60f5b3e3438fd19f775 100644
--- a/chrome/browser/ui/webui/predictors/autocomplete_action_predictor_dom_handler.cc
+++ b/chrome/browser/ui/webui/predictors/predictors_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_handler.h"
#include "base/bind.h"
#include "base/values.h"
@@ -11,27 +11,23 @@
#include "chrome/browser/profiles/profile.h"
#include "content/public/browser/web_ui.h"
-AutocompleteActionPredictorDOMHandler::AutocompleteActionPredictorDOMHandler(
- Profile* profile) {
+using predictors::AutocompleteActionPredictor;
+
+PredictorsHandler::PredictorsHandler(Profile* profile) {
autocomplete_action_predictor_ =
- AutocompleteActionPredictorFactory::GetForProfile(profile);
+ predictors::AutocompleteActionPredictorFactory::GetForProfile(profile);
}
-AutocompleteActionPredictorDOMHandler::~AutocompleteActionPredictorDOMHandler()
-{
-}
+PredictorsHandler::~PredictorsHandler() { }
-void AutocompleteActionPredictorDOMHandler::RegisterMessages() {
+void PredictorsHandler::RegisterMessages() {
web_ui()->RegisterMessageCallback("requestAutocompleteActionPredictorDb",
- base::Bind(
- &AutocompleteActionPredictorDOMHandler::
- RequestAutocompleteActionPredictorDb,
- base::Unretained(this)));
+ base::Bind(&PredictorsHandler::RequestAutocompleteActionPredictorDb,
+ base::Unretained(this)));
}
-void
- AutocompleteActionPredictorDOMHandler::RequestAutocompleteActionPredictorDb(
- const base::ListValue* args) {
+void PredictorsHandler::RequestAutocompleteActionPredictorDb(
+ const base::ListValue* args) {
const bool enabled = (autocomplete_action_predictor_ != NULL);
base::DictionaryValue dict;
dict.SetBoolean("enabled", enabled);
@@ -52,8 +48,7 @@ void
db->Append(entry);
}
dict.Set("db", db);
- dict.SetDouble("hit_weight",
- AutocompleteActionPredictor::get_hit_weight());
+ dict.SetDouble("hit_weight", AutocompleteActionPredictor::get_hit_weight());
}
web_ui()->CallJavascriptFunction("updateDatabaseTable", dict);
« no previous file with comments | « chrome/browser/ui/webui/predictors/predictors_handler.h ('k') | chrome/browser/ui/webui/predictors/predictors_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698