Home | History | Annotate | Download | only in base
      1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef NET_BASE_PLATFORM_MIME_UTIL_H_
      6 #define NET_BASE_PLATFORM_MIME_UTIL_H_
      7 #pragma once
      8 
      9 #include <string>
     10 
     11 #include "base/file_path.h"
     12 
     13 namespace net {
     14 
     15 // Encapsulates the platform-specific functionality in mime_util
     16 class PlatformMimeUtil {
     17  public:
     18   // See documentation for base::GetPreferredExtensionForMimeType [mime_util.h]
     19   bool GetPreferredExtensionForMimeType(const std::string& mime_type,
     20                                         FilePath::StringType* extension) const;
     21  protected:
     22 
     23   // Get the mime type (if any) that is associated with the file extension.
     24   // Returns true if a corresponding mime type exists.
     25   bool GetPlatformMimeTypeFromExtension(const FilePath::StringType& ext,
     26                                         std::string* mime_type) const;
     27 };
     28 
     29 }  // namespace net
     30 
     31 #endif  // NET_BASE_PLATFORM_MIME_UTIL_H_
     32