diff options
Diffstat (limited to 'net/base/platform_mime_util_linux.cc')
-rw-r--r-- | net/base/platform_mime_util_linux.cc | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/net/base/platform_mime_util_linux.cc b/net/base/platform_mime_util_linux.cc new file mode 100644 index 0000000..1d7dccc --- /dev/null +++ b/net/base/platform_mime_util_linux.cc @@ -0,0 +1,40 @@ +// Copyright (c) 2006-2008 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. + +#include <string> + +#include "net/base/platform_mime_util.h" + +namespace net { + +bool PlatformMimeUtil::GetPlatformMimeTypeFromExtension( + const std::wstring& ext, std::string* result) const { + // The correct thing to do is to interact somehow with the freedesktop shared + // mime info cache. Since Linux (and other traditional *IX systems) don't use + // file extensions; they use mime types and have multiple ways of detecting + // that; some types can be guessed from globs (*.gif), but there's a whole + // bunch that use a magic byte test. + // + // Since this method only is called from inside mime_util where there is + // already a hard coded table of mime types, we just return false because it + // doesn't matter. + + return false; +} + +bool PlatformMimeUtil::GetPreferredExtensionForMimeType( + const std::string& mime_type, std::wstring* ext) const { + // Unlike GetPlatformMimeTypeFromExtension, this method doesn't have a + // default list that it uses, but for now we are also returning false since + // this doesn't really matter as much under Linux. + // + // If we wanted to do this properly, we would read the mime.cache file which + // has a section where they assign a glob (*.gif) to a mimetype + // (image/gif). We look up the "heaviest" glob for a certain mime type and + // then then try to chop off "*.". + + return false; +} + +} // namespace net |