diff options
author | abarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-15 07:34:45 +0000 |
---|---|---|
committer | abarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-15 07:34:45 +0000 |
commit | 7d257761656ca0b2ada61e148dbe1c314ecb6ff8 (patch) | |
tree | 0db93d54fc6fb87eeafcefb16543509ac76e71e3 /net | |
parent | be2095f9f7d9b27848c2a3937d0fcb9530ee32f2 (diff) | |
download | chromium_src-7d257761656ca0b2ada61e148dbe1c314ecb6ff8.zip chromium_src-7d257761656ca0b2ada61e148dbe1c314ecb6ff8.tar.gz chromium_src-7d257761656ca0b2ada61e148dbe1c314ecb6ff8.tar.bz2 |
revert 8087
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8088 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/base/mime_util.cc | 9 | ||||
-rw-r--r-- | net/base/mime_util_unittest.cc | 5 |
2 files changed, 6 insertions, 8 deletions
diff --git a/net/base/mime_util.cc b/net/base/mime_util.cc index 03d09ad..e3ef145 100644 --- a/net/base/mime_util.cc +++ b/net/base/mime_util.cc @@ -242,9 +242,12 @@ bool MimeUtil::IsViewSourceMimeType(const char* mime_type) const { // Mirrors WebViewImpl::CanShowMIMEType() bool MimeUtil::IsSupportedMimeType(const std::string& mime_type) const { - return (mime_type.compare(0, 6, "image/") == 0 && - IsSupportedImageMimeType(mime_type.c_str())) || - IsSupportedNonImageMimeType(mime_type.c_str()); + if (mime_type.compare(0, 5, "text/") == 0 || + (mime_type.compare(0, 6, "image/") == 0 && + IsSupportedImageMimeType(mime_type.c_str())) || + IsSupportedNonImageMimeType(mime_type.c_str())) + return true; + return false; } bool MimeUtil::MatchesMimeType(const std::string &mime_type_pattern, diff --git a/net/base/mime_util_unittest.cc b/net/base/mime_util_unittest.cc index a49dfe3..d966005 100644 --- a/net/base/mime_util_unittest.cc +++ b/net/base/mime_util_unittest.cc @@ -65,11 +65,6 @@ TEST(MimeUtilTest, LookupTypes) { EXPECT_EQ(false, net::IsSupportedImageMimeType("image/lolcat")); EXPECT_EQ(true, net::IsSupportedNonImageMimeType("text/html")); EXPECT_EQ(false, net::IsSupportedNonImageMimeType("text/virus")); - - EXPECT_EQ(true, net::IsSupportedMimeType("image/jpeg")); - EXPECT_EQ(false, net::IsSupportedMimeType("image/lolcat")); - EXPECT_EQ(true, net::IsSupportedMimeType("text/html")); - EXPECT_EQ(false, net::IsSupportedMimeType("text/virus")); } TEST(MimeUtilTest, MatchesMimeType) { |