This source file includes following definitions.
- GetMimeTypeForPath
#include "chrome/browser/chromeos/file_manager/mime_util.h"
#include "base/files/file_path.h"
#include "net/base/mime_util.h"
namespace file_manager {
namespace util {
std::string GetMimeTypeForPath(const base::FilePath& file_path) {
const base::FilePath::StringType file_extension = file_path.Extension();
std::string mime_type;
if (file_extension.empty() ||
!net::GetWellKnownMimeTypeFromExtension(file_extension.substr(1),
&mime_type)) {
return "";
} else {
return mime_type;
}
}
}
}