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

Unified Diff: chrome/browser/ui/omnibox/omnibox_controller.cc

Issue 17022004: Replace --google-base-suggest-url and --instant-url with --google-base-url. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 6 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
« no previous file with comments | « chrome/browser/ui/browser_commands.cc ('k') | chrome/browser/ui/omnibox/omnibox_edit_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « chrome/browser/ui/browser_commands.cc ('k') | chrome/browser/ui/omnibox/omnibox_edit_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698