Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(914)

Unified Diff: mojo/services/html_viewer/webmimeregistry_impl.cc

Issue 1088363002: html_viewer: Implement various mime utilities. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/html_viewer/webmimeregistry_impl.cc
diff --git a/mojo/services/html_viewer/webmimeregistry_impl.cc b/mojo/services/html_viewer/webmimeregistry_impl.cc
index 0b7b689393fafa9eb356646caa8aa924eda1670b..9878e8725c9d6f82dd7c9f07b65293ddc922c022 100644
--- a/mojo/services/html_viewer/webmimeregistry_impl.cc
+++ b/mojo/services/html_viewer/webmimeregistry_impl.cc
@@ -111,20 +111,26 @@ blink::WebMimeRegistry::SupportsType
blink::WebString WebMimeRegistryImpl::mimeTypeForExtension(
const blink::WebString& file_extension) {
- NOTIMPLEMENTED();
- return blink::WebString();
+ std::string mime_type;
+ net::GetMimeTypeFromExtension(
+ base::FilePath::FromUTF16Unsafe(file_extension).value(), &mime_type);
+ return blink::WebString::fromUTF8(mime_type);
}
blink::WebString WebMimeRegistryImpl::wellKnownMimeTypeForExtension(
const blink::WebString& file_extension) {
- NOTIMPLEMENTED();
- return blink::WebString();
+ std::string mime_type;
+ net::GetWellKnownMimeTypeFromExtension(
+ base::FilePath::FromUTF16Unsafe(file_extension).value(), &mime_type);
+ return blink::WebString::fromUTF8(mime_type);
}
blink::WebString WebMimeRegistryImpl::mimeTypeFromFile(
const blink::WebString& file_path) {
- NOTIMPLEMENTED();
- return blink::WebString();
+ std::string mime_type;
+ net::GetMimeTypeFromFile(base::FilePath::FromUTF16Unsafe(file_path),
+ &mime_type);
+ return blink::WebString::fromUTF8(mime_type);
}
} // namespace html_viewer
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698