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

Unified Diff: chrome/browser/download/download_manager.cc

Issue 113920: Dangerous download dialog for linux.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: mac uses DownloadManager? Created 11 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/download/download_exe.cc ('k') | chrome/browser/download/download_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_manager.cc
===================================================================
--- chrome/browser/download/download_manager.cc (revision 17020)
+++ chrome/browser/download/download_manager.cc (working copy)
@@ -43,9 +43,13 @@
#if defined(OS_WIN)
#include "app/win_util.h"
-// TODO(port): some of these need porting.
#include "base/registry.h"
#include "base/win_util.h"
+#endif
+
+#if !defined(OS_MACOSX)
+// Used for initializing the list of dangerous extensions. We don't support it
+// yet on mac.
#include "chrome/browser/download/download_util.h"
#endif
@@ -503,8 +507,8 @@
file_loop_->PostTask(FROM_HERE, NewRunnableFunction(
CreateDirectoryPtr, download_path()));
-#if defined(OS_WIN)
- // We use this on windows to determine possibly dangerous downloads.
+#if defined(OS_WIN) || defined(OS_LINUX)
+ // We use this to determine possibly dangerous downloads.
download_util::InitializeExeTypes(&exe_types_);
#endif
@@ -1320,19 +1324,21 @@
}
bool DownloadManager::IsExecutable(const FilePath::StringType& extension) {
-#if defined(OS_WIN)
+#if defined(OS_MACOSX)
+ // We don't have dangerous download support on mac yet.
+ return false;
+#else
if (!IsStringASCII(extension))
return false;
+#if defined(OS_WIN)
std::string ascii_extension = WideToASCII(extension);
+#elif defined(OS_LINUX)
+ std::string ascii_extension = extension;
+#endif
StringToLowerASCII(&ascii_extension);
return exe_types_.find(ascii_extension) != exe_types_.end();
-#elif defined(OS_POSIX)
- // TODO(port): we misght not want to call this function on other platforms.
- // Figure it out.
- NOTIMPLEMENTED();
- return false;
-#endif
+#endif // !defined(OS_MACOSX)
}
void DownloadManager::ResetAutoOpenFiles() {
« no previous file with comments | « chrome/browser/download/download_exe.cc ('k') | chrome/browser/download/download_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698