summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-12 19:28:39 +0000
committerabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-12 19:28:39 +0000
commit6f5ceb6d1bdf5293cec2de6d844e2ca3ca92999e (patch)
treebdc34bc2a5098b879714580dc13bc750895d1155
parent5f15b43bc935cf478dbc0bcb14c5c7a5f7e62a58 (diff)
downloadchromium_src-6f5ceb6d1bdf5293cec2de6d844e2ca3ca92999e.zip
chromium_src-6f5ceb6d1bdf5293cec2de6d844e2ca3ca92999e.tar.gz
chromium_src-6f5ceb6d1bdf5293cec2de6d844e2ca3ca92999e.tar.bz2
Included text/css content type into list of the supported non image files.
Now css files are opened inside browser instead of download. Also - making lint happy on the mime_util.cc BUG=7192 R=abarth TEST=MimeTypeTests.MimeTypeTests Patch by Yuri Gorobets. Original review URL: http://codereview.chromium.org/125005 Review URL: http://codereview.chromium.org/125058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18306 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--AUTHORS1
-rw-r--r--net/base/mime_util.cc12
-rw-r--r--webkit/glue/mimetype_unittest.cc6
3 files changed, 14 insertions, 5 deletions
diff --git a/AUTHORS b/AUTHORS
index dc08f7d..764a26a 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -41,3 +41,4 @@ Will Hirsch <chromium@willhirsch.co.uk>
Yoav Zilberberg <yoav.zilberberg@gmail.com>
Joel Stanley <joel@jms.id.au>
Jacob Mandelson <jacob@mandelson.org>
+Yuri Gorobets <yuri.gorobets@gmail.com>
diff --git a/net/base/mime_util.cc b/net/base/mime_util.cc
index f34645f..71a7311 100644
--- a/net/base/mime_util.cc
+++ b/net/base/mime_util.cc
@@ -37,7 +37,7 @@ class MimeUtil : public PlatformMimeUtil {
bool MatchesMimeType(const std::string &mime_type_pattern,
const std::string &mime_type) const;
-private:
+ private:
friend struct DefaultSingletonTraits<MimeUtil>;
MimeUtil() {
InitializeMimeTypeMaps();
@@ -52,7 +52,7 @@ private:
MimeMappings non_image_map_;
MimeMappings javascript_map_;
MimeMappings view_source_map_;
-}; // class MimeUtil
+}; // class MimeUtil
struct MimeInfo {
const char* mime_type;
@@ -196,8 +196,14 @@ static const char* const supported_non_image_types[] = {
"text/xml",
"text/xsl",
"text/plain",
+ // Many users complained about css files served for
+ // download instead of displaying in the browser:
+ // http://code.google.com/p/chromium/issues/detail?id=7192
+ // So, by including "text/css" into this list we choose Firefox
+ // behavior - css files will be displayed:
+ "text/css",
"text/",
- "image/svg+xml", // SVG is text-based XML, even though it has an image/ type
+ "image/svg+xml", // SVG is text-based XML, even though it has an image/ type
"application/xml",
"application/xhtml+xml",
"application/rss+xml",
diff --git a/webkit/glue/mimetype_unittest.cc b/webkit/glue/mimetype_unittest.cc
index 57fbae6..427c0b1 100644
--- a/webkit/glue/mimetype_unittest.cc
+++ b/webkit/glue/mimetype_unittest.cc
@@ -48,8 +48,10 @@ TEST_F(MimeTypeTests, MimeTypeTests) {
// Firefox 3: Display
// Internet Explorer 7: Download
// Safari 3.2: Download
- // We choose to match Safari.
- // "text/css",
+ // We choose to match Firefox due to the lot of complains
+ // from the users if css files are downloaded:
+ // http://code.google.com/p/chromium/issues/detail?id=7192
+ "text/css",
"text/javascript",
"text/plain",
"application/x-javascript",