Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1350)

Unified Diff: base/mime_util.h

Issue 113168: Add xdg mime support on Linux. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/base.gyp ('k') | base/mime_util_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/mime_util.h
===================================================================
--- base/mime_util.h (revision 0)
+++ base/mime_util.h (revision 0)
@@ -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_
« no previous file with comments | « base/base.gyp ('k') | base/mime_util_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698