| 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 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 break; | 979 break; |
| 980 | 980 |
| 981 case GOOGLE_INPUT_TYPE: | 981 case GOOGLE_INPUT_TYPE: |
| 982 DCHECK(!i->is_post_param); | 982 DCHECK(!i->is_post_param); |
| 983 HandleReplacement( | 983 HandleReplacement( |
| 984 "oit", base::IntToString(search_terms_args.input_type), *i, &url); | 984 "oit", base::IntToString(search_terms_args.input_type), *i, &url); |
| 985 break; | 985 break; |
| 986 | 986 |
| 987 case GOOGLE_INSTANT_EXTENDED_ENABLED: | 987 case GOOGLE_INSTANT_EXTENDED_ENABLED: |
| 988 DCHECK(!i->is_post_param); | 988 DCHECK(!i->is_post_param); |
| 989 // Regular search requests don't use Instant, so only add the param for |
| 990 // other types. |
| 989 HandleReplacement(std::string(), | 991 HandleReplacement(std::string(), |
| 990 search_terms_data.InstantExtendedEnabledParam( | 992 type_ == SEARCH |
| 991 type_ == SEARCH), | 993 ? std::string() |
| 992 *i, | 994 : search_terms_data.InstantExtendedEnabledParam(), |
| 993 &url); | 995 *i, &url); |
| 994 break; | 996 break; |
| 995 | 997 |
| 996 case GOOGLE_CONTEXTUAL_SEARCH_VERSION: | 998 case GOOGLE_CONTEXTUAL_SEARCH_VERSION: |
| 997 if (search_terms_args.contextual_search_params.version >= 0) { | 999 if (search_terms_args.contextual_search_params.version >= 0) { |
| 998 HandleReplacement( | 1000 HandleReplacement( |
| 999 "ctxs", | 1001 "ctxs", |
| 1000 base::IntToString( | 1002 base::IntToString( |
| 1001 search_terms_args.contextual_search_params.version), | 1003 search_terms_args.contextual_search_params.version), |
| 1002 *i, | 1004 *i, |
| 1003 &url); | 1005 &url); |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1541 // patterns. This means that given patterns | 1543 // patterns. This means that given patterns |
| 1542 // [ "http://foo/#q={searchTerms}", "http://foo/?q={searchTerms}" ], | 1544 // [ "http://foo/#q={searchTerms}", "http://foo/?q={searchTerms}" ], |
| 1543 // calling ExtractSearchTermsFromURL() on "http://foo/?q=bar#q=' would | 1545 // calling ExtractSearchTermsFromURL() on "http://foo/?q=bar#q=' would |
| 1544 // return false. This is important for at least Google, where such URLs | 1546 // return false. This is important for at least Google, where such URLs |
| 1545 // are invalid. | 1547 // are invalid. |
| 1546 return !search_terms->empty(); | 1548 return !search_terms->empty(); |
| 1547 } | 1549 } |
| 1548 } | 1550 } |
| 1549 return false; | 1551 return false; |
| 1550 } | 1552 } |
| OLD | NEW |