OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_impl.h" | 5 #include "content/browser/mime_registry_impl.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
10 #include "mojo/common/common_type_converters.h" | 10 #include "mojo/common/common_type_converters.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 mojo::MakeStrongBinding(base::MakeUnique<MimeRegistryImpl>(), | 23 mojo::MakeStrongBinding(base::MakeUnique<MimeRegistryImpl>(), |
24 std::move(request)); | 24 std::move(request)); |
25 } | 25 } |
26 | 26 |
27 void MimeRegistryImpl::GetMimeTypeFromExtension( | 27 void MimeRegistryImpl::GetMimeTypeFromExtension( |
28 const std::string& extension, | 28 const std::string& extension, |
29 const GetMimeTypeFromExtensionCallback& callback) { | 29 const GetMimeTypeFromExtensionCallback& callback) { |
30 DCHECK_CURRENTLY_ON(BrowserThread::FILE); | 30 DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
31 std::string mime_type; | 31 std::string mime_type; |
32 net::GetMimeTypeFromExtension( | 32 net::GetMimeTypeFromExtension( |
33 mojo::String(extension).To<base::FilePath::StringType>(), &mime_type); | 33 base::FilePath::FromUTF8Unsafe(extension).value(), &mime_type); |
34 callback.Run(mime_type); | 34 callback.Run(mime_type); |
35 } | 35 } |
36 | 36 |
37 } // namespace content | 37 } // namespace content |
OLD | NEW |