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

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: Fixed build errors Created 7 years, 9 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/search/search.h ('k') | chrome/browser/ui/toolbar/toolbar_model_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/search/search.cc
diff --git a/chrome/browser/ui/search/search.cc b/chrome/browser/ui/search/search.cc
index 6544bd1423f326f6311f8b8561ca1cc0404ec09f..967a5935de672e5872dae286174624bbd90102a3 100644
--- a/chrome/browser/ui/search/search.cc
+++ b/chrome/browser/ui/search/search.cc
@@ -46,7 +46,11 @@ enum InstantExtendedDefault {
// 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 InstantExtendedDefault kInstantExtendedActivationDefault =
@@ -217,7 +221,13 @@ const char kLocalOmniboxPopupURL[] =
"chrome://local-omnibox-popup/local-omnibox-popup.html";
bool IsInstantExtendedAPIEnabled() {
- return EmbeddedSearchPageVersion() != kEmbeddedPageVersionDisabled;
+#if defined(OS_IOS) || defined(OS_ANDROID)
+ return false;
+#else
+ // On desktop, query extraction is part of Instant extended, so if one is
+ // enabled, the other is too.
+ return IsQueryExtractionEnabled();
+#endif // defined(OS_IOS) || defined(OS_ANDROID)
}
// Determine what embedded search page version to request from the user's
@@ -246,19 +256,11 @@ uint64 EmbeddedSearchPageVersion() {
kEmbeddedPageVersionDefault,
flags);
}
-
return kEmbeddedPageVersionDisabled;
}
bool IsQueryExtractionEnabled() {
-#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();
-#endif
+ return EmbeddedSearchPageVersion() != kEmbeddedPageVersionDisabled;
}
string16 GetSearchTermsFromNavigationEntry(
@@ -427,15 +429,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 GetFieldTrialInfo(const std::string& group_name,
FieldTrialFlags* flags,
uint64* group_number) {
« no previous file with comments | « chrome/browser/ui/search/search.h ('k') | chrome/browser/ui/toolbar/toolbar_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698