Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: chrome/browser/download/download_extensions.cc

Issue 49353005: Make all PDF-related file extensions non-"dangerous". (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <set> 5 #include <set>
6 #include <string> 6 #include <string>
7 7
8 #include "chrome/browser/download/download_extensions.h" 8 #include "chrome/browser/download/download_extensions.h"
9 9
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 DownloadDangerLevel level; 61 DownloadDangerLevel level;
62 } g_executables[] = { 62 } g_executables[] = {
63 // Chrome OS does not suffer from some of the problems of older OS'es. 63 // Chrome OS does not suffer from some of the problems of older OS'es.
64 #if !defined(OS_CHROMEOS) 64 #if !defined(OS_CHROMEOS)
65 // Relating to Java. 65 // Relating to Java.
66 { "class", DANGEROUS }, 66 { "class", DANGEROUS },
67 { "jar", DANGEROUS }, 67 { "jar", DANGEROUS },
68 { "jnlp", DANGEROUS }, 68 { "jnlp", DANGEROUS },
69 #endif 69 #endif
70 #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) 70 #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
71 // Relating to PDF. ".pdf" per se is not considered dangerous.
72 { "pdfxml", ALLOW_ON_USER_GESTURE },
73 { "mars", ALLOW_ON_USER_GESTURE },
74 { "fdf", ALLOW_ON_USER_GESTURE },
75 { "xfdf", ALLOW_ON_USER_GESTURE },
76 { "xdp", ALLOW_ON_USER_GESTURE },
77 { "xfd", ALLOW_ON_USER_GESTURE },
78 // Relating to scripting languages. 71 // Relating to scripting languages.
79 { "pl", ALLOW_ON_USER_GESTURE }, 72 { "pl", ALLOW_ON_USER_GESTURE },
80 { "py", ALLOW_ON_USER_GESTURE }, 73 { "py", ALLOW_ON_USER_GESTURE },
81 { "pyc", ALLOW_ON_USER_GESTURE }, 74 { "pyc", ALLOW_ON_USER_GESTURE },
82 { "pyw", ALLOW_ON_USER_GESTURE }, 75 { "pyw", ALLOW_ON_USER_GESTURE },
83 { "rb", ALLOW_ON_USER_GESTURE }, 76 { "rb", ALLOW_ON_USER_GESTURE },
84 #endif 77 #endif
85 // Some files are dangerous on all platforms. 78 // Some files are dangerous on all platforms.
86 // Flash files downloaded locally can sometimes access the local filesystem. 79 // Flash files downloaded locally can sometimes access the local filesystem.
87 { "swf", ALLOW_ON_USER_GESTURE }, 80 { "swf", ALLOW_ON_USER_GESTURE },
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 for (size_t i = 0; i < arraysize(kExecutableBlackList); ++i) { 266 for (size_t i = 0; i < arraysize(kExecutableBlackList); ++i) {
274 if (net::MatchesMimeType(kExecutableBlackList[i], mime_type)) 267 if (net::MatchesMimeType(kExecutableBlackList[i], mime_type))
275 return false; 268 return false;
276 } 269 }
277 // We consider only other application types to be executable. 270 // We consider only other application types to be executable.
278 return net::MatchesMimeType("application/*", mime_type); 271 return net::MatchesMimeType("application/*", mime_type);
279 } 272 }
280 273
281 274
282 } // namespace download_util 275 } // namespace download_util
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698