Home | History | Annotate | Download | only in search_engines

Lines Matching refs:URL

21 #include "url/gurl.h"
22 #include "url/url_constants.h"
31 const char kURLElement[] = "Url";
91 // Returns true if |url| is empty or is a valid URL with a scheme of HTTP[S].
92 bool IsHTTPRef(const std::string& url) {
93 if (url.empty())
95 GURL gurl(url);
96 return gurl.is_valid() && (gurl.SchemeIs(url::kHttpScheme) ||
97 gurl.SchemeIs(url::kHttpsScheme));
114 URL,
140 // reason (e.g. the resulting URL was not HTTP[S], a name wasn't supplied,
172 // The list of parameters parsed in the Param nodes of a Url node.
179 // If true, we are currently parsing a suggest URL, otherwise it is an HTML
180 // search. Note that we don't need a stack as URL nodes cannot be nested.
183 // Whether we should derive the image from the URL (when images are data
210 // Remove the namespace from |name|, ex: os:Url -> Url.
222 case TemplateURLParsingContext::URL:
248 if (image_url.SchemeIs(url::kDataScheme)) {
249 // TODO (jcampan): bug 1169256: when dealing with data URL, we need to
250 // decode the data URL in the renderer. For now, we'll just point to the
251 // favicon from the URL.
254 (image_url.SchemeIs(url::kHttpScheme) ||
255 image_url.SchemeIs(url::kHttpsScheme))) {
267 case TemplateURLParsingContext::URL:
290 !IsHTTPRef(data_.url()) || !IsHTTPRef(data_.suggestions_url))
295 // If the image was a data URL, use the favicon from the search URL instead.
297 GURL search_url(data_.url());
304 // Bail if the search URL is empty or if either TemplateURLRef is invalid.
308 if (template_url->url().empty() ||
321 (*kElementNameToElementTypeMap)[kURLElement] = URL;
415 GURL url(is_suggest_url_ ? data_.suggestions_url : data_.url());
416 if (url.is_empty())
419 // If there is a parameter filter, parse the existing URL and remove any
424 url::Component query = url.parsed_for_possibly_invalid_spec().query;
425 url::Component key, value;
426 const char* url_spec = url.spec().c_str();
427 while (url::ExtractQueryKeyValue(url_spec, &query, &key, &value)) {
438 new_query = url.query();
451 url = url.ReplaceComponents(repl);
453 data_.suggestions_url = url.spec();
454 else if (url.is_valid())
455 data_.SetURL(url.spec());
463 // We only expect PARAM nodes under the URL node.
465 elements_[1] == URL && elements_[2] == PARAM) ? PARAM : UNKNOWN;