OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_MIME_REGISTRY_MESSAGE_FILTER_H_ | 5 #ifndef CONTENT_BROWSER_MIME_REGISTRY_MESSAGE_FILTER_H_ |
6 #define CONTENT_BROWSER_MIME_REGISTRY_MESSAGE_FILTER_H_ | 6 #define CONTENT_BROWSER_MIME_REGISTRY_MESSAGE_FILTER_H_ |
7 | 7 |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "content/browser/browser_message_filter.h" | 9 #include "content/browser/browser_message_filter.h" |
10 | 10 |
11 class MimeRegistryMessageFilter : public BrowserMessageFilter { | 11 class MimeRegistryMessageFilter : public BrowserMessageFilter { |
12 public: | 12 public: |
13 MimeRegistryMessageFilter(); | 13 MimeRegistryMessageFilter(); |
14 | 14 |
15 virtual void OverrideThreadForMessage(const IPC::Message& message, | 15 virtual void OverrideThreadForMessage(const IPC::Message& message, |
16 BrowserThread::ID* thread); | 16 BrowserThread::ID* thread); |
17 virtual bool OnMessageReceived(const IPC::Message& message, | 17 virtual bool OnMessageReceived(const IPC::Message& message, |
18 bool* message_was_ok); | 18 bool* message_was_ok); |
19 | 19 |
20 private: | 20 private: |
21 ~MimeRegistryMessageFilter(); | 21 virtual ~MimeRegistryMessageFilter(); |
22 | 22 |
23 void OnGetMimeTypeFromExtension(const FilePath::StringType& ext, | 23 void OnGetMimeTypeFromExtension(const FilePath::StringType& ext, |
24 std::string* mime_type); | 24 std::string* mime_type); |
25 void OnGetMimeTypeFromFile(const FilePath& file_path, | 25 void OnGetMimeTypeFromFile(const FilePath& file_path, |
26 std::string* mime_type); | 26 std::string* mime_type); |
27 void OnGetPreferredExtensionForMimeType(const std::string& mime_type, | 27 void OnGetPreferredExtensionForMimeType(const std::string& mime_type, |
28 FilePath::StringType* extension); | 28 FilePath::StringType* extension); |
29 }; | 29 }; |
30 | 30 |
31 #endif // CONTENT_BROWSER_MIME_REGISTRY_MESSAGE_FILTER_H_ | 31 #endif // CONTENT_BROWSER_MIME_REGISTRY_MESSAGE_FILTER_H_ |
OLD | NEW |