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

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

Issue 22761003: Remove PDF-related extensions from the danger list on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 months 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 static const struct Executables { 59 static const struct Executables {
60 const char* extension; 60 const char* extension;
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
70 #if !defined(OS_CHROMEOS) || !defined(OS_ANDROID)
asanka 2013/08/09 21:33:30 You want && here.
palmer 2013/08/09 22:56:09 Done.
69 // Relating to PDF. 71 // Relating to PDF.
70 { "pdf", ALLOW_ON_USER_GESTURE }, 72 { "pdf", ALLOW_ON_USER_GESTURE },
71 { "pdfxml", ALLOW_ON_USER_GESTURE }, 73 { "pdfxml", ALLOW_ON_USER_GESTURE },
72 { "mars", ALLOW_ON_USER_GESTURE }, 74 { "mars", ALLOW_ON_USER_GESTURE },
73 { "fdf", ALLOW_ON_USER_GESTURE }, 75 { "fdf", ALLOW_ON_USER_GESTURE },
74 { "xfdf", ALLOW_ON_USER_GESTURE }, 76 { "xfdf", ALLOW_ON_USER_GESTURE },
75 { "xdp", ALLOW_ON_USER_GESTURE }, 77 { "xdp", ALLOW_ON_USER_GESTURE },
76 { "xfd", ALLOW_ON_USER_GESTURE }, 78 { "xfd", ALLOW_ON_USER_GESTURE },
77 // Relating to scripting languages. 79 // Relating to scripting languages.
78 { "pl", ALLOW_ON_USER_GESTURE }, 80 { "pl", ALLOW_ON_USER_GESTURE },
79 { "py", ALLOW_ON_USER_GESTURE }, 81 { "py", ALLOW_ON_USER_GESTURE },
82 { "pyc", ALLOW_ON_USER_GESTURE },
80 { "pyw", ALLOW_ON_USER_GESTURE }, 83 { "pyw", ALLOW_ON_USER_GESTURE },
81 { "rb", ALLOW_ON_USER_GESTURE }, 84 { "rb", ALLOW_ON_USER_GESTURE },
82 #endif 85 #endif
83 // Some files are dangerous on all platforms. 86 // Some files are dangerous on all platforms.
84 // Flash files downloaded locally can sometimes access the local filesystem. 87 // Flash files downloaded locally can sometimes access the local filesystem.
85 { "swf", ALLOW_ON_USER_GESTURE }, 88 { "swf", ALLOW_ON_USER_GESTURE },
86 // Chrome extensions should be obtained through the web store. 89 // Chrome extensions should be obtained through the web store.
87 { "crx", ALLOW_ON_USER_GESTURE }, 90 { "crx", ALLOW_ON_USER_GESTURE },
88 // These types can run JavaScript (e.g. HTML and HTML-like). 91 // These types can run JavaScript (e.g. HTML and HTML-like).
89 // TODO(cevans): work out whether our restrictions on file:/// are strong 92 // TODO(cevans): work out whether our restrictions on file:/// are strong
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 for (size_t i = 0; i < arraysize(kExecutableBlackList); ++i) { 274 for (size_t i = 0; i < arraysize(kExecutableBlackList); ++i) {
272 if (net::MatchesMimeType(kExecutableBlackList[i], mime_type)) 275 if (net::MatchesMimeType(kExecutableBlackList[i], mime_type))
273 return false; 276 return false;
274 } 277 }
275 // We consider only other application types to be executable. 278 // We consider only other application types to be executable.
276 return net::MatchesMimeType("application/*", mime_type); 279 return net::MatchesMimeType("application/*", mime_type);
277 } 280 }
278 281
279 282
280 } // namespace download_util 283 } // 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