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

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

Issue 12319124: Enable query extraction for Android (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed kEnableQueryExtraction Created 7 years, 10 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 3594ebdbf35e2e4e9eeb20b687ba7fd6e59bd561..013f9067b3561b34b8ab73613b3df44894263923 100644
--- a/chrome/browser/ui/search/search.cc
+++ b/chrome/browser/ui/search/search.cc
@@ -31,7 +31,11 @@ namespace {
// space-delimited list of key:value pairs which correspond to these flags:
const char kEmbeddedPageVersionFlagName[] = "espv";
const uint64 kEmbeddedPageVersionDisabled = 0;
+#if defined(OS_IOS) || defined(OS_ANDROID)
+const uint64 kEmbeddedPageVersionDefault = 1;
+#else
const uint64 kEmbeddedPageVersionDefault = 2;
+#endif
const char kInstantExtendedActivationName[] = "instant";
const chrome::search::InstantExtendedDefault kInstantExtendedActivationDefault =
@@ -153,7 +157,13 @@ InstantExtendedDefault GetInstantExtendedDefaultSetting() {
}
bool IsInstantExtendedAPIEnabled(const Profile* profile) {
- return EmbeddedSearchPageVersion(profile) != kEmbeddedPageVersionDisabled;
+#if defined(OS_IOS) || defined(OS_ANDROID)
+ return false;
+#else
+ // On desktop, query extraction is part of instant extended, so if one is
sreeram 2013/03/05 17:45:55 Nit: instant -> instant
sreeram 2013/03/05 17:46:24 Gah. I meant: instant -> Instant
Yusuf 2013/03/05 18:57:31 Done.
+ // enabled, the other is too.
+ return IsQueryExtractionEnabled(profile);
+#endif // defined(OS_IOS) || defined(OS_ANDROID)
}
// Determine what embedded search page version to request from the user's
@@ -185,19 +195,11 @@ uint64 EmbeddedSearchPageVersion(const Profile* profile) {
kEmbeddedPageVersionDefault,
flags);
}
-
return kEmbeddedPageVersionDisabled;
}
bool IsQueryExtractionEnabled(const Profile* profile) {
-#if defined(OS_IOS)
- const CommandLine* cl = CommandLine::ForCurrentProcess();
- return cl->HasSwitch(switches::kEnableQueryExtraction);
-#else
- // On desktop, query extraction is controlled by the instant-extended-api
- // flag.
- return IsInstantExtendedAPIEnabled(profile);
-#endif
+ return EmbeddedSearchPageVersion(profile) != kEmbeddedPageVersionDisabled;
}
string16 GetSearchTermsFromNavigationEntry(
@@ -284,15 +286,6 @@ void EnableInstantExtendedAPIForTesting() {
cl->AppendSwitch(switches::kEnableInstantExtendedAPI);
}
-void EnableQueryExtractionForTesting() {
-#if defined(OS_IOS)
- CommandLine* cl = CommandLine::ForCurrentProcess();
- cl->AppendSwitch(switches::kEnableQueryExtraction);
-#else
- EnableInstantExtendedAPIForTesting();
-#endif
-}
-
bool ShouldAssignURLToInstantRendererImpl(const GURL& url,
bool extended_api_enabled,
TemplateURL* template_url) {

Powered by Google App Engine
This is Rietveld 408576698