| Index: chrome/browser/autocomplete/search_provider.cc
|
| diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc
|
| index 89d29257b45d18355f036406f556a99ad4426500..97227058f1be644f9f97fbb7901918e2f21ef256 100644
|
| --- a/chrome/browser/autocomplete/search_provider.cc
|
| +++ b/chrome/browser/autocomplete/search_provider.cc
|
| @@ -36,6 +36,10 @@
|
| #include "chrome/browser/search_engines/template_url_prepopulate_data.h"
|
| #include "chrome/browser/search_engines/template_url_service.h"
|
| #include "chrome/browser/search_engines/template_url_service_factory.h"
|
| +#include "chrome/browser/ui/browser.h"
|
| +#include "chrome/browser/ui/browser_finder.h"
|
| +#include "chrome/browser/ui/browser_instant_controller.h"
|
| +#include "chrome/browser/ui/search/instant_controller.h"
|
| #include "chrome/common/net/url_fixer_upper.h"
|
| #include "chrome/common/pref_names.h"
|
| #include "chrome/common/url_constants.h"
|
| @@ -251,7 +255,6 @@ SearchProvider::SearchProvider(AutocompleteProviderListener* listener,
|
| suggest_results_pending_(0),
|
| field_trial_triggered_(false),
|
| field_trial_triggered_in_session_(false),
|
| - omnibox_start_margin_(-1),
|
| prevent_search_history_inlining_(
|
| OmniboxFieldTrial::SearchHistoryPreventInlining()),
|
| disable_search_history_(
|
| @@ -373,10 +376,6 @@ void SearchProvider::ResetSession() {
|
| field_trial_triggered_in_session_ = false;
|
| }
|
|
|
| -void SearchProvider::SetOmniboxStartMargin(int omnibox_start_margin) {
|
| - omnibox_start_margin_ = omnibox_start_margin;
|
| -}
|
| -
|
| SearchProvider::~SearchProvider() {
|
| }
|
|
|
| @@ -1380,11 +1379,22 @@ void SearchProvider::AddMatchToMap(const string16& query_string,
|
| int accepted_suggestion,
|
| bool is_keyword,
|
| MatchMap* map) {
|
| + int omnibox_start_margin = chrome::kDisableStartMargin;
|
| + if (chrome::IsInstantExtendedAPIEnabled()) {
|
| + Browser* browser =
|
| + chrome::FindBrowserWithProfile(profile_, chrome::GetActiveDesktop());
|
| + if (browser && browser->instant_controller() &&
|
| + browser->instant_controller()->instant()) {
|
| + omnibox_start_margin =
|
| + browser->instant_controller()->instant()->GetOmniboxBounds().x();
|
| + }
|
| + }
|
| +
|
| const TemplateURL* template_url = is_keyword ?
|
| providers_.GetKeywordProviderURL() : providers_.GetDefaultProviderURL();
|
| AutocompleteMatch match = CreateSearchSuggestion(this, relevance, type,
|
| template_url, query_string, input_text, input_, is_keyword,
|
| - accepted_suggestion, omnibox_start_margin_,
|
| + accepted_suggestion, omnibox_start_margin,
|
| !is_keyword || providers_.default_provider().empty());
|
| if (!match.destination_url.is_valid())
|
| return;
|
|
|