Index: chrome/browser/ui/omnibox/omnibox_controller.cc |
=================================================================== |
--- chrome/browser/ui/omnibox/omnibox_controller.cc (revision 208572) |
+++ chrome/browser/ui/omnibox/omnibox_controller.cc (working copy) |
@@ -25,24 +25,7 @@ |
#include "extensions/common/constants.h" |
#include "ui/gfx/rect.h" |
-using predictors::AutocompleteActionPredictor; |
-namespace { |
- |
-string16 GetDefaultSearchProviderKeyword(Profile* profile) { |
- TemplateURLService* template_url_service = |
- TemplateURLServiceFactory::GetForProfile(profile); |
- if (template_url_service) { |
- TemplateURL* template_url = |
- template_url_service->GetDefaultSearchProvider(); |
- if (template_url) |
- return template_url->keyword(); |
- } |
- return string16(); |
-} |
- |
-} // namespace |
- |
OmniboxController::OmniboxController(OmniboxEditModel* omnibox_edit_model, |
Profile* profile) |
: omnibox_edit_model_(omnibox_edit_model), |
@@ -268,7 +251,7 @@ |
if (profile_->GetNetworkPredictor()) { |
profile_->GetNetworkPredictor()->AnticipateOmniboxUrl( |
match.destination_url, |
- AutocompleteActionPredictor::IsPreconnectable(match)); |
+ predictors::AutocompleteActionPredictor::IsPreconnectable(match)); |
} |
// We could prefetch the alternate nav URL, if any, but because there |
// can be many of these as a user types an initial series of characters, |
@@ -310,11 +293,17 @@ |
string16 query_string, |
string16 input_text, |
AutocompleteMatchType::Type match_type) { |
- string16 keyword = GetDefaultSearchProviderKeyword(profile_); |
- if (keyword.empty()) |
- return; // CreateSearchSuggestion needs a keyword. |
+ TemplateURLService* template_url_service = |
+ TemplateURLServiceFactory::GetForProfile(profile_); |
+ if (!template_url_service) |
+ return; |
+ TemplateURL* template_url = |
+ template_url_service->GetDefaultSearchProvider(); |
+ if (!template_url) |
+ return; |
+ |
current_match_ = SearchProvider::CreateSearchSuggestion( |
- profile_, NULL, AutocompleteInput(), query_string, input_text, 0, |
- match_type, 0, false, keyword, -1); |
+ NULL, 0, match_type, template_url, query_string, input_text, |
+ AutocompleteInput(), false, 0, -1, true); |
} |