| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/child/simple_webmimeregistry_impl.h" | 5 #include "content/child/simple_webmimeregistry_impl.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 } | 92 } |
| 93 | 93 |
| 94 WebString SimpleWebMimeRegistryImpl::wellKnownMimeTypeForExtension( | 94 WebString SimpleWebMimeRegistryImpl::wellKnownMimeTypeForExtension( |
| 95 const WebString& file_extension) { | 95 const WebString& file_extension) { |
| 96 std::string mime_type; | 96 std::string mime_type; |
| 97 net::GetWellKnownMimeTypeFromExtension( | 97 net::GetWellKnownMimeTypeFromExtension( |
| 98 base::FilePath::FromUTF16Unsafe(file_extension).value(), &mime_type); | 98 base::FilePath::FromUTF16Unsafe(file_extension).value(), &mime_type); |
| 99 return WebString::fromUTF8(mime_type); | 99 return WebString::fromUTF8(mime_type); |
| 100 } | 100 } |
| 101 | 101 |
| 102 WebString SimpleWebMimeRegistryImpl::mimeTypeFromFile( | |
| 103 const WebString& file_path) { | |
| 104 std::string mime_type; | |
| 105 net::GetMimeTypeFromFile(base::FilePath::FromUTF16Unsafe(file_path), | |
| 106 &mime_type); | |
| 107 return WebString::fromUTF8(mime_type); | |
| 108 } | |
| 109 | |
| 110 } // namespace content | 102 } // namespace content |
| OLD | NEW |