Chromium Code Reviews| Index: chrome/browser/history/url_database.cc |
| =================================================================== |
| --- chrome/browser/history/url_database.cc (revision 216076) |
| +++ chrome/browser/history/url_database.cc (working copy) |
| @@ -12,6 +12,7 @@ |
| #include "base/i18n/case_conversion.h" |
| #include "base/strings/utf_string_conversions.h" |
| #include "chrome/common/url_constants.h" |
| +#include "net/base/net_util.h" |
| #include "sql/statement.h" |
| #include "ui/base/l10n/l10n_util.h" |
| #include "url/gurl.h" |
| @@ -371,6 +372,16 @@ |
| std::vector<QueryWord> query_words; |
| string16 url = base::i18n::ToLower(statement.ColumnString16(1)); |
| query_parser_.ExtractQueryWords(url, &query_words); |
| + GURL gurl(url); |
| + if (gurl.is_valid()) { |
| + // Decode punycode to match IDN. |
| + // |query_words| won't be shown to user - therefore we can use empty |
| + // |languages| to reduce dependency (no need to call PrefService). |
| + string16 ascii = base::i18n::ToLower(base::ASCIIToUTF16(gurl.host())); |
|
brettw
2013/09/03 20:44:31
You don't need this stuff. A GURL's host is guaran
yuusuke
2013/09/04 08:31:12
Done.
|
| + string16 utf = base::i18n::ToLower(net::IDNToUnicode(gurl.host(), "")); |
|
brettw
2013/09/03 20:44:31
I don't think you need to ToLower call here. I bel
yuusuke
2013/09/04 08:31:12
Done.
|
| + if (ascii != utf) |
| + query_parser_.ExtractQueryWords(utf, &query_words); |
| + } |
| string16 title = base::i18n::ToLower(statement.ColumnString16(2)); |
| query_parser_.ExtractQueryWords(title, &query_words); |