| Index: chrome/browser/ui/search/search.cc
|
| diff --git a/chrome/browser/ui/search/search.cc b/chrome/browser/ui/search/search.cc
|
| index fae8bb0ae34d232d76e93cd1750a3f084285f47e..bdb8a6b9eca383ff6e619a797ef348e2d9c59ec0 100644
|
| --- a/chrome/browser/ui/search/search.cc
|
| +++ b/chrome/browser/ui/search/search.cc
|
| @@ -10,6 +10,8 @@
|
| #include "base/string_split.h"
|
| #include "base/string_util.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| +#include "chrome/browser/search_engines/template_url_service.h"
|
| +#include "chrome/browser/search_engines/template_url_service_factory.h"
|
| #include "chrome/common/chrome_switches.h"
|
| #include "chrome/common/chrome_version_info.h"
|
|
|
| @@ -114,6 +116,15 @@ uint64 EmbeddedSearchPageVersion(Profile* profile) {
|
| if (!profile || profile->IsOffTheRecord())
|
| return 0;
|
|
|
| + // Some users may have their search provider TemplateURL pinned to an
|
| + // obsolete value which does not support enabling InstantExtended on the
|
| + // server side. Bail out of InstantExtended if we detect that.
|
| + const TemplateURL* template_url =
|
| + TemplateURLServiceFactory::GetForProfile(profile)->
|
| + GetDefaultSearchProvider();
|
| + if (!template_url || !template_url->SupportsInstantExtendedParam())
|
| + return 0;
|
| +
|
| // Check Finch field trials.
|
| FieldTrialFlags flags;
|
| uint64 group_number = 0;
|
| @@ -151,6 +162,7 @@ uint64 EmbeddedSearchPageVersion(Profile* profile) {
|
| // UI version.
|
| return kEmbeddedPageVersionDefault;
|
| }
|
| +
|
| return 0;
|
| }
|
|
|
|
|