OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_MIME_REGISTRY_DISPATCHER_H_ | |
6 #define CHROME_BROWSER_MIME_REGISTRY_DISPATCHER_H_ | |
7 | |
8 #include "base/file_path.h" | |
9 #include "base/ref_counted.h" | |
10 #include "ipc/ipc_message.h" | |
11 | |
12 class MimeRegistryDispatcher | |
13 : public base::RefCountedThreadSafe<MimeRegistryDispatcher> { | |
14 public: | |
15 explicit MimeRegistryDispatcher(IPC::Message::Sender* sender); | |
16 void Shutdown(); | |
17 bool OnMessageReceived(const IPC::Message& message); | |
18 void Send(IPC::Message* message); | |
19 | |
20 private: | |
21 friend class base::RefCountedThreadSafe<MimeRegistryDispatcher>; | |
22 ~MimeRegistryDispatcher(); | |
23 | |
24 void OnGetMimeTypeFromExtension(const FilePath::StringType& ext, | |
25 IPC::Message* reply); | |
26 void OnGetMimeTypeFromFile(const FilePath& file_path, | |
27 IPC::Message* reply); | |
28 void OnGetPreferredExtensionForMimeType(const std::string& mime_type, | |
29 IPC::Message* reply); | |
30 | |
31 // The sender to be used for sending out IPC messages. | |
32 IPC::Message::Sender* message_sender_; | |
33 | |
34 DISALLOW_IMPLICIT_CONSTRUCTORS(MimeRegistryDispatcher); | |
35 }; | |
36 | |
37 #endif // CHROME_BROWSER_MIME_REGISTRY_DISPATCHER_H_ | |
OLD | NEW |