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

Unified Diff: chrome/browser/ui/search/search.cc

Issue 11884037: InstantExtended: Bail on TemplateURLs with no espv. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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/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;
}

Powered by Google App Engine
This is Rietveld 408576698