Don't use MatchesExtension for matching filters

MatchesExtension compares double extensions like .tar.gz, which does not
match the filters.
This commit is contained in:
Cheng Zhao 2016-07-01 22:55:15 +09:00
parent 36a0a491c9
commit 431ea61ff8

View file

@ -211,7 +211,9 @@ base::FilePath FileChooserDialog::AddExtensionForFilename(
const auto& extensions = filters_[i].second;
for (const auto& extension : extensions) {
if (extension == "*" || path.MatchesExtension("." + extension))
if (extension == "*" ||
base::EndsWith(path.value(), "." + extension,
base::CompareCase::INSENSITIVE_ASCII))
return path;
}