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

Side by Side Diff: mojo/services/html_viewer/webmimeregistry_impl.cc

Issue 511583002: Update mojo's WebMimeRegistry for supportsImagePrefixed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « mojo/services/html_viewer/webmimeregistry_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "mojo/services/html_viewer/webmimeregistry_impl.h" 5 #include "mojo/services/html_viewer/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 18 matching lines...) Expand all
29 } 29 }
30 30
31 blink::WebMimeRegistry::SupportsType WebMimeRegistryImpl::supportsImageMIMEType( 31 blink::WebMimeRegistry::SupportsType WebMimeRegistryImpl::supportsImageMIMEType(
32 const blink::WebString& mime_type) { 32 const blink::WebString& mime_type) {
33 return net::IsSupportedImageMimeType(ToASCIIOrEmpty(mime_type)) ? 33 return net::IsSupportedImageMimeType(ToASCIIOrEmpty(mime_type)) ?
34 blink::WebMimeRegistry::IsSupported : 34 blink::WebMimeRegistry::IsSupported :
35 blink::WebMimeRegistry::IsNotSupported; 35 blink::WebMimeRegistry::IsNotSupported;
36 } 36 }
37 37
38 blink::WebMimeRegistry::SupportsType 38 blink::WebMimeRegistry::SupportsType
39 WebMimeRegistryImpl::supportsImagePrefixedMIMEType(
40 const blink::WebString& mime_type) {
41 std::string ascii_mime_type = ToASCIIOrEmpty(mime_type);
42 return (net::IsSupportedImageMimeType(ascii_mime_type) ||
43 (StartsWithASCII(ascii_mime_type, "image/", true) &&
44 net::IsSupportedNonImageMimeType(ascii_mime_type)))
45 ? WebMimeRegistry::IsSupported
46 : WebMimeRegistry::IsNotSupported;
47 }
48
49 blink::WebMimeRegistry::SupportsType
39 WebMimeRegistryImpl::supportsJavaScriptMIMEType( 50 WebMimeRegistryImpl::supportsJavaScriptMIMEType(
40 const blink::WebString& mime_type) { 51 const blink::WebString& mime_type) {
41 return net::IsSupportedJavascriptMimeType(ToASCIIOrEmpty(mime_type)) ? 52 return net::IsSupportedJavascriptMimeType(ToASCIIOrEmpty(mime_type)) ?
42 blink::WebMimeRegistry::IsSupported : 53 blink::WebMimeRegistry::IsSupported :
43 blink::WebMimeRegistry::IsNotSupported; 54 blink::WebMimeRegistry::IsNotSupported;
44 } 55 }
45 56
46 blink::WebMimeRegistry::SupportsType WebMimeRegistryImpl::supportsMediaMIMEType( 57 blink::WebMimeRegistry::SupportsType WebMimeRegistryImpl::supportsMediaMIMEType(
47 const blink::WebString& mime_type, 58 const blink::WebString& mime_type,
48 const blink::WebString& codecs, 59 const blink::WebString& codecs,
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 return blink::WebString(); 97 return blink::WebString();
87 } 98 }
88 99
89 blink::WebString WebMimeRegistryImpl::mimeTypeFromFile( 100 blink::WebString WebMimeRegistryImpl::mimeTypeFromFile(
90 const blink::WebString& file_path) { 101 const blink::WebString& file_path) {
91 NOTIMPLEMENTED(); 102 NOTIMPLEMENTED();
92 return blink::WebString(); 103 return blink::WebString();
93 } 104 }
94 105
95 } // namespace mojo 106 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/services/html_viewer/webmimeregistry_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698