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

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

Issue 165295: Add "dangerous download" view on OS X, for now for dmg files. Also fix download item layout. (Closed)
Patch Set: Address comments Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/download/download_exe.cc ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_manager.cc
diff --git a/chrome/browser/download/download_manager.cc b/chrome/browser/download/download_manager.cc
index 9c1cb1197d6e6228a697fa19433407500d2cf3bd..a00c115b252e8845fb825acb220dd88f3b4ecf39 100644
--- a/chrome/browser/download/download_manager.cc
+++ b/chrome/browser/download/download_manager.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/browser_list.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/download/download_file.h"
+#include "chrome/browser/download/download_util.h"
#include "chrome/browser/extensions/extension_install_ui.h"
#include "chrome/browser/extensions/extensions_service.h"
#include "chrome/browser/profile.h"
@@ -46,11 +47,6 @@
#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
#if defined(OS_LINUX)
#include <gtk/gtk.h>
@@ -528,10 +524,8 @@ bool DownloadManager::Init(Profile* profile) {
file_loop_->PostTask(FROM_HERE, NewRunnableFunction(
CreateDirectoryPtr, download_path()));
-#if defined(OS_WIN) || defined(OS_LINUX)
// We use this to determine possibly dangerous downloads.
download_util::InitializeExeTypes(&exe_types_);
-#endif
// We store any file extension that should be opened automatically at
// download completion in this pref.
@@ -1335,21 +1329,16 @@ bool DownloadManager::IsExecutableMimeType(const std::string& mime_type) {
}
bool DownloadManager::IsExecutable(const FilePath::StringType& extension) {
-#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)
+#elif defined(OS_POSIX)
std::string ascii_extension = extension;
#endif
StringToLowerASCII(&ascii_extension);
return exe_types_.find(ascii_extension) != exe_types_.end();
-#endif // !defined(OS_MACOSX)
}
void DownloadManager::ResetAutoOpenFiles() {
« no previous file with comments | « chrome/browser/download/download_exe.cc ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698