summaryrefslogtreecommitdiffstats
path: root/base/mime_util.h
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-16 04:30:05 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-16 04:30:05 +0000
commitbff1ddf84a4743c05f754cf55875b7f510dbb364 (patch)
tree10ccf3c02a1d510ea0c6c9282b192a20b2063497 /base/mime_util.h
parent85b9984be3cf3566ab3bb6f9b719876b551525f3 (diff)
downloadchromium_src-bff1ddf84a4743c05f754cf55875b7f510dbb364.zip
chromium_src-bff1ddf84a4743c05f754cf55875b7f510dbb364.tar.gz
chromium_src-bff1ddf84a4743c05f754cf55875b7f510dbb364.tar.bz2
Add xdg mime support on Linux.
BUG=10049 Review URL: http://codereview.chromium.org/113168 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16227 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/mime_util.h')
-rw-r--r--base/mime_util.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/base/mime_util.h b/base/mime_util.h
new file mode 100644
index 0000000..850613b
--- /dev/null
+++ b/base/mime_util.h
@@ -0,0 +1,28 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_MIME_UTIL_H_
+#define BASE_MIME_UTIL_H_
+
+#include <string>
+
+class FilePath;
+
+namespace mime_util {
+
+// Gets the mime type for a file based on its filename. The file path does not
+// have to exist. Please note because it doesn't touch the disk, this does not
+// work for directories.
+// If the mime type is unknown, this will return application/octet-stream.
+std::string GetFileMimeType(const std::string& file_path);
+
+// Gets the file name for an icon given the mime type and icon pixel size.
+// Where an icon is a square image of |size| x |size|.
+// This will try to find the closest matching icon. If that's not available,
+// then a generic icon, and finally an empty FilePath if all else fails.
+FilePath GetMimeIcon(const std::string& mime_type, size_t size);
+
+} // namespace mime_util
+
+#endif // BASE_MIME_UTIL_H_