Home | History | Annotate | Download | only in browser
      1 // Copyright (c) 2011 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 CONTENT_BROWSER_MIME_REGISTRY_MESSAGE_FILTER_H_
      6 #define CONTENT_BROWSER_MIME_REGISTRY_MESSAGE_FILTER_H_
      7 
      8 #include "base/files/file_path.h"
      9 #include "content/public/browser/browser_message_filter.h"
     10 
     11 namespace content {
     12 
     13 class MimeRegistryMessageFilter : public BrowserMessageFilter {
     14  public:
     15   MimeRegistryMessageFilter();
     16 
     17   virtual void OverrideThreadForMessage(
     18       const IPC::Message& message,
     19       BrowserThread::ID* thread) OVERRIDE;
     20   virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
     21 
     22  private:
     23   virtual ~MimeRegistryMessageFilter();
     24 
     25   void OnGetMimeTypeFromExtension(const base::FilePath::StringType& ext,
     26                                   std::string* mime_type);
     27   void OnGetMimeTypeFromFile(const base::FilePath& file_path,
     28                              std::string* mime_type);
     29 };
     30 
     31 }  // namespace content
     32 
     33 #endif  // CONTENT_BROWSER_MIME_REGISTRY_MESSAGE_FILTER_H_
     34