download_extensions.h revision 21d179b334e59e9a3bfcaed4c4430bef1bc5759d
1// Copyright (c) 2010 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5#ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_EXTENSIONS_H_ 6#define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_EXTENSIONS_H_ 7#pragma once 8 9#include <string> 10 11#include "base/file_path.h" 12 13namespace download_util { 14 15enum DownloadDangerLevel { 16 NotDangerous, 17 AllowOnUserGesture, 18 Dangerous 19}; 20 21// Determine the download danger level of a file. 22DownloadDangerLevel GetFileDangerLevel(const FilePath& path); 23 24// Determine the download danger level using a file extension. 25DownloadDangerLevel GetFileExtensionDangerLevel( 26 const FilePath::StringType& extension); 27 28// True if the download danger level of the file is NotDangerous. 29bool IsFileSafe(const FilePath& path); 30 31// True if the download danger level of the extension is NotDangerous. 32bool IsFileExtensionSafe(const FilePath::StringType& extension); 33 34// Tests if we think the server means for this mime_type to be executable. 35bool IsExecutableMimeType(const std::string& mime_type); 36 37} // namespace download_util 38 39#endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_EXTENSIONS_H_ 40