| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/webui/predictors/predictors_handler.h" | 5 #include "chrome/browser/ui/webui/predictors/predictors_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/predictors/autocomplete_action_predictor.h" | 9 #include "chrome/browser/predictors/autocomplete_action_predictor.h" |
| 10 #include "chrome/browser/predictors/autocomplete_action_predictor_factory.h" | 10 #include "chrome/browser/predictors/autocomplete_action_predictor_factory.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 base::DictionaryValue* entry = new base::DictionaryValue(); | 41 base::DictionaryValue* entry = new base::DictionaryValue(); |
| 42 entry->SetString("user_text", it->first.user_text); | 42 entry->SetString("user_text", it->first.user_text); |
| 43 entry->SetString("url", it->first.url.spec()); | 43 entry->SetString("url", it->first.url.spec()); |
| 44 entry->SetInteger("hit_count", it->second.number_of_hits); | 44 entry->SetInteger("hit_count", it->second.number_of_hits); |
| 45 entry->SetInteger("miss_count", it->second.number_of_misses); | 45 entry->SetInteger("miss_count", it->second.number_of_misses); |
| 46 entry->SetDouble("confidence", | 46 entry->SetDouble("confidence", |
| 47 autocomplete_action_predictor_->CalculateConfidenceForDbEntry(it)); | 47 autocomplete_action_predictor_->CalculateConfidenceForDbEntry(it)); |
| 48 db->Append(entry); | 48 db->Append(entry); |
| 49 } | 49 } |
| 50 dict.Set("db", db); | 50 dict.Set("db", db); |
| 51 dict.SetDouble("hit_weight", AutocompleteActionPredictor::get_hit_weight()); | |
| 52 } | 51 } |
| 53 | 52 |
| 54 web_ui()->CallJavascriptFunction("updateDatabaseTable", dict); | 53 web_ui()->CallJavascriptFunction("updateDatabaseTable", dict); |
| 55 } | 54 } |
| OLD | NEW |