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

Unified Diff: components/search_engines/template_url.cc

Issue 2806593006: Changed GenerateKeyword to always return keyword in lowercase (Closed)
Patch Set: Fixed after review, round 1 Created 3 years, 8 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: components/search_engines/template_url.cc
diff --git a/components/search_engines/template_url.cc b/components/search_engines/template_url.cc
index c091758bb34cdc0c5867354710e48210291497b9..f1e4303f915c35f8421aedc73d35d817fc090b30 100644
--- a/components/search_engines/template_url.cc
+++ b/components/search_engines/template_url.cc
@@ -9,6 +9,7 @@
#include "base/command_line.h"
#include "base/format_macros.h"
+#include "base/i18n/case_conversion.h"
#include "base/i18n/icu_string_conversions.h"
#include "base/i18n/rtl.h"
#include "base/logging.h"
@@ -1198,7 +1199,8 @@ base::string16 TemplateURL::GenerateKeyword(const GURL& url) {
// Special case: if the host was exactly "www." (not sure this can happen but
// perhaps with some weird intranet and custom DNS server?), ensure we at
// least don't return the empty string.
- return keyword.empty() ? base::ASCIIToUTF16("www") : keyword;
+ return keyword.empty() ? base::ASCIIToUTF16("www")
+ : base::i18n::ToLower(keyword);
}
// static
« no previous file with comments | « chrome/browser/search_engines/template_url_service_unittest.cc ('k') | components/search_engines/template_url_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698