Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/search_engines/template_url.h" | 5 #include "components/search_engines/template_url.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 961 | 961 |
| 962 case GOOGLE_INPUT_TYPE: | 962 case GOOGLE_INPUT_TYPE: |
| 963 DCHECK(!i->is_post_param); | 963 DCHECK(!i->is_post_param); |
| 964 HandleReplacement( | 964 HandleReplacement( |
| 965 "oit", base::IntToString(search_terms_args.input_type), *i, &url); | 965 "oit", base::IntToString(search_terms_args.input_type), *i, &url); |
| 966 break; | 966 break; |
| 967 | 967 |
| 968 case GOOGLE_INSTANT_EXTENDED_ENABLED: | 968 case GOOGLE_INSTANT_EXTENDED_ENABLED: |
| 969 DCHECK(!i->is_post_param); | 969 DCHECK(!i->is_post_param); |
| 970 HandleReplacement(std::string(), | 970 HandleReplacement(std::string(), |
| 971 search_terms_data.InstantExtendedEnabledParam( | 971 type_ == SEARCH |
|
Peter Kasting
2016/11/22 22:00:44
Nit: Add comment about why we want this to be the
Marc Treib
2016/11/23 10:29:19
Done.
| |
| 972 type_ == SEARCH), | 972 ? std::string() |
| 973 *i, | 973 : search_terms_data.InstantExtendedEnabledParam(), |
| 974 &url); | 974 *i, &url); |
| 975 break; | 975 break; |
| 976 | 976 |
| 977 case GOOGLE_CONTEXTUAL_SEARCH_VERSION: | 977 case GOOGLE_CONTEXTUAL_SEARCH_VERSION: |
| 978 if (search_terms_args.contextual_search_params.version >= 0) { | 978 if (search_terms_args.contextual_search_params.version >= 0) { |
| 979 HandleReplacement( | 979 HandleReplacement( |
| 980 "ctxs", | 980 "ctxs", |
| 981 base::IntToString( | 981 base::IntToString( |
| 982 search_terms_args.contextual_search_params.version), | 982 search_terms_args.contextual_search_params.version), |
| 983 *i, | 983 *i, |
| 984 &url); | 984 &url); |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1524 // patterns. This means that given patterns | 1524 // patterns. This means that given patterns |
| 1525 // [ "http://foo/#q={searchTerms}", "http://foo/?q={searchTerms}" ], | 1525 // [ "http://foo/#q={searchTerms}", "http://foo/?q={searchTerms}" ], |
| 1526 // calling ExtractSearchTermsFromURL() on "http://foo/?q=bar#q=' would | 1526 // calling ExtractSearchTermsFromURL() on "http://foo/?q=bar#q=' would |
| 1527 // return false. This is important for at least Google, where such URLs | 1527 // return false. This is important for at least Google, where such URLs |
| 1528 // are invalid. | 1528 // are invalid. |
| 1529 return !search_terms->empty(); | 1529 return !search_terms->empty(); |
| 1530 } | 1530 } |
| 1531 } | 1531 } |
| 1532 return false; | 1532 return false; |
| 1533 } | 1533 } |
| OLD | NEW |