Chromium Code Reviews| 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..00e7c2df28da40335cfb7611c13217ddb8fee184 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 = |
| @@ -144,6 +149,11 @@ bool IsInstantExtendedAPIEnabled(const Profile* profile) { |
| // 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)); |
|
sreeram
2013/03/01 22:36:44
Trailing semicolon oops.
Peter Kasting
2013/03/01 22:42:49
Do we need to use a distinct command-line flag fro
|
| + return kEmbeddedPageVersionDefault; |
| +#else |
| if (!profile || profile->IsOffTheRecord()) |
| return 0; |
| @@ -162,19 +172,15 @@ uint64 EmbeddedSearchPageVersion(const Profile* profile) { |
| // UI version. |
| return kEmbeddedPageVersionDefault; |
| } |
| - |
| +#endif // defined(OS_IOS) || defined(OS_ANDROID) |
|
sreeram
2013/03/01 22:36:44
Two spaces before "//".
|
| return 0; |
| } |
| 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. |
| + // flag. For iOS and Android, the below function returns true if the |
| + // enable-query-extraction flag is present. |
| return IsInstantExtendedAPIEnabled(profile); |
| -#endif |
| } |
| string16 GetSearchTermsFromNavigationEntry( |
| @@ -262,7 +268,7 @@ void EnableInstantExtendedAPIForTesting() { |
| } |
| void EnableQueryExtractionForTesting() { |
| -#if defined(OS_IOS) |
| +#if defined(OS_IOS) || defined(OS_ANDROID) |
| CommandLine* cl = CommandLine::ForCurrentProcess(); |
| cl->AppendSwitch(switches::kEnableQueryExtraction); |
| #else |