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/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1076 break; | 1076 break; |
1077 } | 1077 } |
1078 | 1078 |
1079 case GOOGLE_SEARCH_FIELDTRIAL_GROUP: | 1079 case GOOGLE_SEARCH_FIELDTRIAL_GROUP: |
1080 // We are not currently running any fieldtrials that modulate the search | 1080 // We are not currently running any fieldtrials that modulate the search |
1081 // url. If we do, then we'd have some conditional insert such as: | 1081 // url. If we do, then we'd have some conditional insert such as: |
1082 // url.insert(i->index, used_www ? "gcx=w&" : "gcx=c&"); | 1082 // url.insert(i->index, used_www ? "gcx=w&" : "gcx=c&"); |
1083 break; | 1083 break; |
1084 | 1084 |
1085 case GOOGLE_SEARCH_VERSION: | 1085 case GOOGLE_SEARCH_VERSION: |
1086 if (search_terms_data.EnableAnswersInSuggest()) | 1086 HandleReplacement("gs_rn", "42", *i, &url); |
1087 HandleReplacement("gs_rn", "42", *i, &url); | |
1088 break; | 1087 break; |
1089 | 1088 |
1090 case GOOGLE_SESSION_TOKEN: { | 1089 case GOOGLE_SESSION_TOKEN: { |
1091 std::string token = search_terms_args.session_token; | 1090 std::string token = search_terms_args.session_token; |
1092 if (!token.empty()) | 1091 if (!token.empty()) |
1093 HandleReplacement("psi", token, *i, &url); | 1092 HandleReplacement("psi", token, *i, &url); |
1094 break; | 1093 break; |
1095 } | 1094 } |
1096 | 1095 |
1097 case GOOGLE_SUGGEST_CLIENT: | 1096 case GOOGLE_SUGGEST_CLIENT: |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1510 // patterns. This means that given patterns | 1509 // patterns. This means that given patterns |
1511 // [ "http://foo/#q={searchTerms}", "http://foo/?q={searchTerms}" ], | 1510 // [ "http://foo/#q={searchTerms}", "http://foo/?q={searchTerms}" ], |
1512 // calling ExtractSearchTermsFromURL() on "http://foo/?q=bar#q=' would | 1511 // calling ExtractSearchTermsFromURL() on "http://foo/?q=bar#q=' would |
1513 // return false. This is important for at least Google, where such URLs | 1512 // return false. This is important for at least Google, where such URLs |
1514 // are invalid. | 1513 // are invalid. |
1515 return !search_terms->empty(); | 1514 return !search_terms->empty(); |
1516 } | 1515 } |
1517 } | 1516 } |
1518 return false; | 1517 return false; |
1519 } | 1518 } |
OLD | NEW |