Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Unified Diff: chrome/browser/search_engines/template_url_parser.cc

Issue 9965143: Revert 130431 - Move the URL string from TemplateURLRef onto the owning TemplateURL. This will mak… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/search_engines/template_url_parser.cc
===================================================================
--- chrome/browser/search_engines/template_url_parser.cc (revision 130565)
+++ chrome/browser/search_engines/template_url_parser.cc (working copy)
@@ -94,13 +94,14 @@
query->append(value);
}
-// Returns true if |url| is empty or is a valid URL with a scheme of HTTP[S].
-bool IsHTTPRef(const std::string& url) {
- if (url.empty())
+// Returns true if the ref is null, or the url wrapped by ref is
+// valid with a spec of http/https.
+bool IsHTTPRef(const TemplateURLRef* ref) {
+ if (ref == NULL)
return true;
- GURL gurl(url);
- return (gurl.is_valid() && (gurl.SchemeIs(chrome::kHttpScheme) ||
- gurl.SchemeIs(chrome::kHttpsScheme)));
+ GURL url(ref->url());
+ return (url.is_valid() && (url.SchemeIs(chrome::kHttpScheme) ||
+ url.SchemeIs(chrome::kHttpsScheme)));
}
} // namespace
@@ -298,7 +299,7 @@
// If the image was a data URL, use the favicon from the search URL instead.
// (see TODO inEndElementImpl()).
- GURL url(url_->url());
+ GURL url(url_->url()->url());
if (derive_image_from_url_ && url_->favicon_url().is_empty())
url_->set_favicon_url(TemplateURL::GenerateFaviconURL(url));
@@ -413,10 +414,11 @@
if (!parameter_filter_ && extra_params_.empty())
return;
- GURL url(is_suggest_url_ ? url_->suggestions_url() : url_->url());
- if (url.is_empty())
+ const TemplateURLRef* t_url_ref =
+ is_suggest_url_ ? url_->suggestions_url() : url_->url();
+ if (!t_url_ref)
return;
-
+ GURL url(t_url_ref->url());
// If there is a parameter filter, parse the existing URL and remove any
// unwanted parameter.
std::string new_query;

Powered by Google App Engine
This is Rietveld 408576698