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

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

Issue 10933082: Remove .dmg from the list of dangerous file extensions for Mac OS X. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 | 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/string_util.h" 10 #include "base/string_util.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 { "vsmacros", AllowOnUserGesture }, 169 { "vsmacros", AllowOnUserGesture },
170 { "vss", AllowOnUserGesture }, 170 { "vss", AllowOnUserGesture },
171 { "vst", AllowOnUserGesture }, 171 { "vst", AllowOnUserGesture },
172 { "vsw", AllowOnUserGesture }, 172 { "vsw", AllowOnUserGesture },
173 { "ws", AllowOnUserGesture }, 173 { "ws", AllowOnUserGesture },
174 { "wsc", AllowOnUserGesture }, 174 { "wsc", AllowOnUserGesture },
175 { "wsf", AllowOnUserGesture }, 175 { "wsf", AllowOnUserGesture },
176 { "wsh", AllowOnUserGesture }, 176 { "wsh", AllowOnUserGesture },
177 { "xbap", Dangerous }, 177 { "xbap", Dangerous },
178 #elif defined(OS_MACOSX) 178 #elif defined(OS_MACOSX)
179 // TODO(thakis): Figure out what makes sense here -- crbug.com/19096 179 { "bash", AllowOnUserGesture },
180 { "app", AllowOnUserGesture }, 180 { "command", AllowOnUserGesture },
181 { "dmg", AllowOnUserGesture }, 181 { "csh", AllowOnUserGesture },
182 { "ksh", AllowOnUserGesture },
183 { "pkg", AllowOnUserGesture },
184 { "sh", AllowOnUserGesture },
185 { "shar", AllowOnUserGesture },
186 { "tcsh", AllowOnUserGesture },
182 #elif defined(OS_POSIX) 187 #elif defined(OS_POSIX)
183 // TODO(estade): lengthen this list. 188 // TODO(estade): lengthen this list.
184 { "bash", AllowOnUserGesture }, 189 { "bash", AllowOnUserGesture },
185 { "csh", AllowOnUserGesture }, 190 { "csh", AllowOnUserGesture },
186 { "deb", AllowOnUserGesture }, 191 { "deb", AllowOnUserGesture },
187 { "exe", AllowOnUserGesture }, 192 { "exe", AllowOnUserGesture },
188 { "ksh", AllowOnUserGesture }, 193 { "ksh", AllowOnUserGesture },
189 { "rpm", AllowOnUserGesture }, 194 { "rpm", AllowOnUserGesture },
190 { "sh", AllowOnUserGesture }, 195 { "sh", AllowOnUserGesture },
196 { "shar", AllowOnUserGesture },
191 { "tcsh", AllowOnUserGesture }, 197 { "tcsh", AllowOnUserGesture },
192 #endif 198 #endif
193 }; 199 };
194 200
195 DownloadDangerLevel GetFileDangerLevel(const FilePath& path) { 201 DownloadDangerLevel GetFileDangerLevel(const FilePath& path) {
196 FilePath::StringType extension(path.Extension()); 202 FilePath::StringType extension(path.Extension());
197 if (extension.empty()) 203 if (extension.empty())
198 return NotDangerous; 204 return NotDangerous;
199 if (!IsStringASCII(extension)) 205 if (!IsStringASCII(extension))
200 return NotDangerous; 206 return NotDangerous;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 for (size_t i = 0; i < arraysize(kExecutableBlackList); ++i) { 249 for (size_t i = 0; i < arraysize(kExecutableBlackList); ++i) {
244 if (net::MatchesMimeType(kExecutableBlackList[i], mime_type)) 250 if (net::MatchesMimeType(kExecutableBlackList[i], mime_type))
245 return false; 251 return false;
246 } 252 }
247 // We consider only other application types to be executable. 253 // We consider only other application types to be executable.
248 return net::MatchesMimeType("application/*", mime_type); 254 return net::MatchesMimeType("application/*", mime_type);
249 } 255 }
250 256
251 257
252 } // namespace download_util 258 } // 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