Index: chrome/browser/ui/search/search.cc |
diff --git a/chrome/browser/ui/search/search.cc b/chrome/browser/ui/search/search.cc |
index e6d79bd0b396f29bd7fe61063768d7ef381625c2..0861971d2e6f598fc91e79de16655056bd774c90 100644 |
--- a/chrome/browser/ui/search/search.cc |
+++ b/chrome/browser/ui/search/search.cc |
@@ -29,7 +29,12 @@ namespace { |
// The first token is always GroupN for some integer N, followed by a |
// space-delimited list of key:value pairs which correspond to these flags: |
const char kEmbeddedPageVersionFlagName[] = "espv"; |
+ |
+#if defined(OS_IOS) || defined(OS_ANDROID) |
+const int kEmbeddedPageVersionDefault = 1; |
+#else |
const int kEmbeddedPageVersionDefault = 2; |
+#endif |
const char kInstantExtendedActivationName[] = "instant"; |
const chrome::search::InstantExtendedDefault kInstantExtendedActivationDefault = |
@@ -138,12 +143,21 @@ InstantExtendedDefault GetInstantExtendedDefaultSetting() { |
} |
bool IsInstantExtendedAPIEnabled(const Profile* profile) { |
+#if defined(OS_IOS) || defined(OS_ANDROID) |
+ return false; |
+#else |
return EmbeddedSearchPageVersion(profile) != 0; |
Peter Kasting
2013/03/04 23:01:18
Nit: If you change this as follows:
// On deskt
Yusuf
2013/03/04 23:09:37
What I understood from Rohit's comment above was t
rohitrao (ping after 24h)
2013/03/04 23:16:35
Peter was suggesting changing this method to read:
Yusuf
2013/03/04 23:36:36
Oh, OK. Got it now. Fixed in latest patch.
On 20
|
+#endif // defined(OS_IOS) || defined(OS_ANDROID) |
} |
// Determine what embedded search page version to request from the user's |
// default search provider. If 0, the embedded search UI should not be enabled. |
uint64 EmbeddedSearchPageVersion(const Profile* profile) { |
+#if defined(OS_IOS) || defined(OS_ANDROID) |
+ const CommandLine* cl = CommandLine::ForCurrentProcess(); |
+ if (cl->HasSwitch(switches::kEnableQueryExtraction)) |
Peter Kasting
2013/03/04 23:01:18
You didn't answer my previous question about wheth
rohitrao (ping after 24h)
2013/03/04 23:16:35
I don't want to use switches::kEnableInstantExtend
Peter Kasting
2013/03/05 00:19:45
What other code does it trigger? I assumed everyo
rohitrao (ping after 24h)
2013/03/05 00:29:41
IsInstantExtendedAPIEnabled() triggers things like
Peter Kasting
2013/03/05 00:35:31
Yeah, I'm not asking IsIntantExtendedAPIEnabled()
Yusuf
2013/03/05 05:57:24
Uploaded a patch that removed kEnableQueryExtracti
|
+ return kEmbeddedPageVersionDefault; |
+#else |
if (!profile || profile->IsOffTheRecord()) |
return 0; |
@@ -162,19 +176,19 @@ uint64 EmbeddedSearchPageVersion(const Profile* profile) { |
// UI version. |
return kEmbeddedPageVersionDefault; |
} |
- |
+#endif // defined(OS_IOS) || defined(OS_ANDROID) |
return 0; |
} |
bool IsQueryExtractionEnabled(const Profile* profile) { |
-#if defined(OS_IOS) |
+#if defined(OS_IOS) || defined(OS_ANDROID) |
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 |
+#endif // defined(OS_IOS) || defined(OS_ANDROID) |
} |
string16 GetSearchTermsFromNavigationEntry( |
@@ -262,12 +276,12 @@ void EnableInstantExtendedAPIForTesting() { |
} |
void EnableQueryExtractionForTesting() { |
-#if defined(OS_IOS) |
+#if defined(OS_IOS) || defined(OS_ANDROID) |
CommandLine* cl = CommandLine::ForCurrentProcess(); |
cl->AppendSwitch(switches::kEnableQueryExtraction); |
#else |
EnableInstantExtendedAPIForTesting(); |
-#endif |
+#endif // defined(OS_IOS) || defined(OS_ANDROID) |
} |
bool ShouldAssignURLToInstantRendererImpl(const GURL& url, |