Index: chrome/browser/download/download_manager.h |
=================================================================== |
--- chrome/browser/download/download_manager.h (revision 30182) |
+++ chrome/browser/download/download_manager.h (working copy) |
@@ -419,16 +419,19 @@ |
// Registers this file extension for automatic opening upon download |
// completion if 'open' is true, or prevents the extension from automatic |
// opening if 'open' is false. |
- void OpenFilesOfExtension(const FilePath::StringType& extension, bool open); |
+ void OpenFilesBasedOnExtension(const FilePath& path, bool open); |
// Tests if a file type should be opened automatically. |
- bool ShouldOpenFileExtension(const FilePath::StringType& extension); |
+ bool ShouldOpenFileBasedOnExtension(const FilePath& path) const; |
// Tests if we think the server means for this mime_type to be executable. |
static bool IsExecutableMimeType(const std::string& mime_type); |
+ // Tests if a file is considered executable, based on its type. |
+ bool IsExecutableFile(const FilePath& path) const; |
+ |
// Tests if a file type is considered executable. |
- bool IsExecutable(const FilePath::StringType& extension); |
+ bool IsExecutableExtension(const FilePath::StringType& extension) const; |
// Resets the automatic open preference. |
void ResetAutoOpenFiles(); |
@@ -605,7 +608,14 @@ |
FilePath last_download_path_; |
// Set of file extensions to open at download completion. |
- std::set<FilePath::StringType> auto_open_; |
+ struct AutoOpenCompareFunctor { |
+ inline bool operator()(const FilePath::StringType& a, |
+ const FilePath::StringType& b) const { |
+ return FilePath::CompareLessIgnoreCase(a, b); |
+ } |
+ }; |
+ typedef std::set<FilePath::StringType, AutoOpenCompareFunctor> AutoOpenSet; |
+ AutoOpenSet auto_open_; |
// Set of file extensions that are executables and shouldn't be auto opened. |
std::set<std::string> exe_types_; |