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

Unified Diff: chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc

Issue 10909130: autocomplete: Add AutocompleteProvider::Type enum. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add !! for windows Created 8 years, 3 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/omnibox/omnibox_ui_handler.cc
diff --git a/chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc b/chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc
index 651e98d22c6dbcb5f6ad5e18b7ec30ce9a9384f1..ec4a3afea87d8ddb35ed775fddaa9fa470e81549 100644
--- a/chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc
+++ b/chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc
@@ -11,6 +11,7 @@
#include "base/stringprintf.h"
#include "base/time.h"
#include "base/values.h"
+#include "chrome/browser/autocomplete/autocomplete_classifier.h"
#include "chrome/browser/autocomplete/autocomplete_controller.h"
#include "chrome/browser/autocomplete/autocomplete_input.h"
#include "chrome/browser/autocomplete/autocomplete_match.h"
@@ -19,7 +20,8 @@
#include "content/public/browser/web_ui.h"
OmniboxUIHandler::OmniboxUIHandler(Profile* profile ) {
- controller_.reset(new AutocompleteController(profile, this));
+ controller_.reset(new AutocompleteController(profile, this,
+ AutocompleteClassifier::kDefaultOmniboxProviders));
}
OmniboxUIHandler::~OmniboxUIHandler() {}
@@ -77,7 +79,8 @@ void OmniboxUIHandler::OnResultChanged(bool default_match_changed) {
// Fill results from each individual provider as well.
for (ACProviders::const_iterator it(controller_->providers()->begin());
it != controller_->providers()->end(); ++it) {
- AddResultToDictionary(std::string("results_by_provider.") + (*it)->name(),
+ AddResultToDictionary(
+ std::string("results_by_provider.") + (*it)->GetName(),
(*it)->matches().begin(), (*it)->matches().end(), &result_to_output);
}
// Add done; send the results.
@@ -95,7 +98,8 @@ void OmniboxUIHandler::AddResultToDictionary(const std::string& prefix,
for (; it != end; ++it, ++i) {
std::string item_prefix(prefix + StringPrintf(".item_%d", i));
if (it->provider != NULL) {
- output->SetString(item_prefix + ".provider_name", it->provider->name());
+ output->SetString(item_prefix + ".provider_name",
+ it->provider->GetName());
output->SetBoolean(item_prefix + ".provider_done", it->provider->done());
}
output->SetInteger(item_prefix + ".relevance", it->relevance);
« no previous file with comments | « chrome/browser/ui/omnibox/omnibox_edit_model.cc ('k') | chrome/browser/ui/webui/options/home_page_overlay_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698