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

Unified Diff: chrome/browser/ui/search_engines/search_engine_tab_helper.cc

Issue 2624263002: SearchEngineTabHelper: avoid calling TemplateURL::GenerateFaviconURL with empty URL. (Closed)
Patch Set: . Created 3 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/search_engines/search_engine_tab_helper.cc
diff --git a/chrome/browser/ui/search_engines/search_engine_tab_helper.cc b/chrome/browser/ui/search_engines/search_engine_tab_helper.cc
index 6ac56a4a2a3aa241b8751d45311af8d5d32b5754..e9c8fd0adb29205dfb1cdceb62ef99d742019327 100644
--- a/chrome/browser/ui/search_engines/search_engine_tab_helper.cc
+++ b/chrome/browser/ui/search_engines/search_engine_tab_helper.cc
@@ -214,10 +214,12 @@ void SearchEngineTabHelper::GenerateKeywordIfNecessary(
// latter.
// TODO(sky): Need a way to set the favicon that doesn't involve generating
// its url.
- data.favicon_url =
- current_favicon.is_valid()
- ? current_favicon
- : TemplateURL::GenerateFaviconURL(handle->GetReferrer().url);
+ if (current_favicon.is_valid()) {
+ data.favicon_url = current_favicon;
+ } else if (handle->GetReferrer().url.is_valid()) {
+ data.favicon_url =
+ TemplateURL::GenerateFaviconURL(handle->GetReferrer().url);
+ }
data.safe_for_autoreplace = true;
data.input_encodings.push_back(handle->GetSearchableFormEncoding());
url_service->Add(base::MakeUnique<TemplateURL>(data));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698