#ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MEDIA_PATH_FILTER_H_
#define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MEDIA_PATH_FILTER_H_
#include <string>
#include <vector>
#include "base/containers/hash_tables.h"
#include "base/files/file_path.h"
#include "base/sequence_checker.h"
#include "chrome/browser/media_galleries/media_scan_types.h"
class MediaPathFilter {
public:
static bool ShouldSkip(const base::FilePath& path);
MediaPathFilter();
~MediaPathFilter();
bool Match(const base::FilePath& path);
MediaGalleryScanFileType GetType(const base::FilePath& path);
private:
typedef std::vector<base::FilePath::StringType> MediaFileExtensionList;
typedef base::hash_map<base::FilePath::StringType, int> MediaFileExtensionMap;
void EnsureInitialized();
void AddExtensionsToMediaFileExtensionMap(
const MediaFileExtensionList& extensions_list,
MediaGalleryScanFileType type);
void AddAdditionalExtensionsToMediaFileExtensionMap(
const base::FilePath::CharType* const* extensions_list,
size_t extensions_list_size,
MediaGalleryScanFileType type);
void AddExtensionToMediaFileExtensionMap(
const base::FilePath::CharType* extension,
MediaGalleryScanFileType type);
base::SequenceChecker sequence_checker_;
bool initialized_;
MediaFileExtensionMap media_file_extensions_map_;
DISALLOW_COPY_AND_ASSIGN(MediaPathFilter);
};
#endif