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

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

Issue 512983003: Remove .apk from dangerous file extension list (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 193
194 // Package management formats. OS_WIN package formats are handled above. 194 // Package management formats. OS_WIN package formats are handled above.
195 #if defined(OS_MACOSX) || defined(OS_LINUX) 195 #if defined(OS_MACOSX) || defined(OS_LINUX)
196 { "pkg", ALLOW_ON_USER_GESTURE }, 196 { "pkg", ALLOW_ON_USER_GESTURE },
197 #endif 197 #endif
198 #if defined(OS_LINUX) 198 #if defined(OS_LINUX)
199 { "deb", ALLOW_ON_USER_GESTURE }, 199 { "deb", ALLOW_ON_USER_GESTURE },
200 { "rpm", ALLOW_ON_USER_GESTURE }, 200 { "rpm", ALLOW_ON_USER_GESTURE },
201 #endif 201 #endif
202 #if defined(OS_ANDROID) 202 #if defined(OS_ANDROID)
203 { "apk", ALLOW_ON_USER_GESTURE },
204 { "dex", ALLOW_ON_USER_GESTURE }, // Really an executable format. 203 { "dex", ALLOW_ON_USER_GESTURE }, // Really an executable format.
205 #endif 204 #endif
206 }; 205 };
207 206
208 DownloadDangerLevel GetFileDangerLevel(const base::FilePath& path) { 207 DownloadDangerLevel GetFileDangerLevel(const base::FilePath& path) {
209 base::FilePath::StringType extension(path.FinalExtension()); 208 base::FilePath::StringType extension(path.FinalExtension());
210 if (extension.empty()) 209 if (extension.empty())
211 return NOT_DANGEROUS; 210 return NOT_DANGEROUS;
212 if (!base::IsStringASCII(extension)) 211 if (!base::IsStringASCII(extension))
213 return NOT_DANGEROUS; 212 return NOT_DANGEROUS;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 for (size_t i = 0; i < arraysize(kExecutableBlackList); ++i) { 255 for (size_t i = 0; i < arraysize(kExecutableBlackList); ++i) {
257 if (net::MatchesMimeType(kExecutableBlackList[i], mime_type)) 256 if (net::MatchesMimeType(kExecutableBlackList[i], mime_type))
258 return false; 257 return false;
259 } 258 }
260 // We consider only other application types to be executable. 259 // We consider only other application types to be executable.
261 return net::MatchesMimeType("application/*", mime_type); 260 return net::MatchesMimeType("application/*", mime_type);
262 } 261 }
263 262
264 263
265 } // namespace download_util 264 } // 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