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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
197 ContextualSearchParams() | 197 ContextualSearchParams() |
198 : version(-1), | 198 : version(-1), |
199 start(base::string16::npos), | 199 start(base::string16::npos), |
200 end(base::string16::npos), | 200 end(base::string16::npos), |
201 resolve(true) { | 201 resolve(true) { |
202 } | 202 } |
203 | 203 |
204 TemplateURLRef::SearchTermsArgs::ContextualSearchParams:: | 204 TemplateURLRef::SearchTermsArgs::ContextualSearchParams:: |
205 ContextualSearchParams( | 205 ContextualSearchParams( |
206 const int version, | 206 const int version, |
207 const size_t start, | |
208 const size_t end, | |
209 const std::string& selection, | |
donnd
2014/09/16 21:23:18
Jeremy for logging please include the selection to
jeremycho
2014/09/16 21:26:53
Done.
| |
210 const std::string& content, | |
211 const std::string& base_page_url, | 207 const std::string& base_page_url, |
212 const std::string& encoding) | 208 const bool resolve) |
213 : version(version), | 209 : version(version), |
214 start(start), | 210 start(base::string16::npos), |
215 end(end), | 211 end(base::string16::npos), |
216 selection(selection), | |
217 content(content), | |
218 base_page_url(base_page_url), | 212 base_page_url(base_page_url), |
219 encoding(encoding), | 213 resolve(resolve) { |
220 resolve(true) { | |
221 } | 214 } |
222 | 215 |
223 TemplateURLRef::SearchTermsArgs::ContextualSearchParams:: | 216 TemplateURLRef::SearchTermsArgs::ContextualSearchParams:: |
224 ContextualSearchParams( | 217 ContextualSearchParams( |
225 const int version, | 218 const int version, |
226 const size_t start, | 219 const size_t start, |
227 const size_t end, | 220 const size_t end, |
228 const std::string& selection, | 221 const std::string& selection, |
229 const std::string& content, | 222 const std::string& content, |
230 const std::string& base_page_url, | 223 const std::string& base_page_url, |
(...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1469 // patterns. This means that given patterns | 1462 // patterns. This means that given patterns |
1470 // [ "http://foo/#q={searchTerms}", "http://foo/?q={searchTerms}" ], | 1463 // [ "http://foo/#q={searchTerms}", "http://foo/?q={searchTerms}" ], |
1471 // calling ExtractSearchTermsFromURL() on "http://foo/?q=bar#q=' would | 1464 // calling ExtractSearchTermsFromURL() on "http://foo/?q=bar#q=' would |
1472 // return false. This is important for at least Google, where such URLs | 1465 // return false. This is important for at least Google, where such URLs |
1473 // are invalid. | 1466 // are invalid. |
1474 return !search_terms->empty(); | 1467 return !search_terms->empty(); |
1475 } | 1468 } |
1476 } | 1469 } |
1477 return false; | 1470 return false; |
1478 } | 1471 } |
OLD | NEW |