OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <map> | 5 #include <map> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "net/base/mime_util.h" | 8 #include "net/base/mime_util.h" |
9 #include "net/base/platform_mime_util.h" | 9 #include "net/base/platform_mime_util.h" |
10 | 10 |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 // Many users complained about css files served for | 326 // Many users complained about css files served for |
327 // download instead of displaying in the browser: | 327 // download instead of displaying in the browser: |
328 // http://code.google.com/p/chromium/issues/detail?id=7192 | 328 // http://code.google.com/p/chromium/issues/detail?id=7192 |
329 // So, by including "text/css" into this list we choose Firefox | 329 // So, by including "text/css" into this list we choose Firefox |
330 // behavior - css files will be displayed: | 330 // behavior - css files will be displayed: |
331 "text/css", | 331 "text/css", |
332 "text/vnd.chromium.ftp-dir", | 332 "text/vnd.chromium.ftp-dir", |
333 "text/", | 333 "text/", |
334 "image/svg+xml", // SVG is text-based XML, even though it has an image/ type | 334 "image/svg+xml", // SVG is text-based XML, even though it has an image/ type |
335 "application/xml", | 335 "application/xml", |
| 336 "application/atom+xml", |
| 337 "application/rss+xml", |
336 "application/xhtml+xml", | 338 "application/xhtml+xml", |
337 "application/json", | 339 "application/json", |
338 "application/x-x509-user-cert", | 340 "application/x-x509-user-cert", |
339 "multipart/related", // For MHTML support. | 341 "multipart/related", // For MHTML support. |
340 "multipart/x-mixed-replace" | 342 "multipart/x-mixed-replace" |
341 // Note: ADDING a new type here will probably render it AS HTML. This can | 343 // Note: ADDING a new type here will probably render it AS HTML. This can |
342 // result in cross site scripting. | 344 // result in cross site scripting. |
343 }; | 345 }; |
344 | 346 |
345 // These types are excluded from the logic that allows all text/ types because | 347 // These types are excluded from the logic that allows all text/ types because |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
914 const std::string GetIANAMediaType(const std::string& mime_type) { | 916 const std::string GetIANAMediaType(const std::string& mime_type) { |
915 for (size_t i = 0; i < arraysize(kIanaMediaTypes); ++i) { | 917 for (size_t i = 0; i < arraysize(kIanaMediaTypes); ++i) { |
916 if (StartsWithASCII(mime_type, kIanaMediaTypes[i].matcher, true)) { | 918 if (StartsWithASCII(mime_type, kIanaMediaTypes[i].matcher, true)) { |
917 return kIanaMediaTypes[i].name; | 919 return kIanaMediaTypes[i].name; |
918 } | 920 } |
919 } | 921 } |
920 return ""; | 922 return ""; |
921 } | 923 } |
922 | 924 |
923 } // namespace net | 925 } // namespace net |
OLD | NEW |