OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 #include "content/browser/mime_registry_message_filter.h" | 5 #include "content/browser/mime_registry_message_filter.h" |
6 | 6 |
7 #include "content/common/mime_registry_messages.h" | 7 #include "content/common/mime_registry_messages.h" |
8 #include "net/base/mime_util.h" | 8 #include "net/base/mime_util.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
11 | 11 |
12 MimeRegistryMessageFilter::MimeRegistryMessageFilter() | 12 MimeRegistryMessageFilter::MimeRegistryMessageFilter() { |
13 : BrowserMessageFilter(MimeRegistryMsgStart) { | |
14 } | 13 } |
15 | 14 |
16 MimeRegistryMessageFilter::~MimeRegistryMessageFilter() { | 15 MimeRegistryMessageFilter::~MimeRegistryMessageFilter() { |
17 } | 16 } |
18 | 17 |
19 void MimeRegistryMessageFilter::OverrideThreadForMessage( | 18 void MimeRegistryMessageFilter::OverrideThreadForMessage( |
20 const IPC::Message& message, | 19 const IPC::Message& message, |
21 BrowserThread::ID* thread) { | 20 BrowserThread::ID* thread) { |
22 if (IPC_MESSAGE_CLASS(message) == MimeRegistryMsgStart) | 21 if (IPC_MESSAGE_CLASS(message) == MimeRegistryMsgStart) |
23 *thread = BrowserThread::FILE; | 22 *thread = BrowserThread::FILE; |
(...skipping 16 matching lines...) Expand all Loading... |
40 const base::FilePath::StringType& ext, std::string* mime_type) { | 39 const base::FilePath::StringType& ext, std::string* mime_type) { |
41 net::GetMimeTypeFromExtension(ext, mime_type); | 40 net::GetMimeTypeFromExtension(ext, mime_type); |
42 } | 41 } |
43 | 42 |
44 void MimeRegistryMessageFilter::OnGetMimeTypeFromFile( | 43 void MimeRegistryMessageFilter::OnGetMimeTypeFromFile( |
45 const base::FilePath& file_path, std::string* mime_type) { | 44 const base::FilePath& file_path, std::string* mime_type) { |
46 net::GetMimeTypeFromFile(file_path, mime_type); | 45 net::GetMimeTypeFromFile(file_path, mime_type); |
47 } | 46 } |
48 | 47 |
49 } // namespace content | 48 } // namespace content |
OLD | NEW |