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

Side by Side Diff: content/child/simple_webmimeregistry_impl.cc

Issue 176843022: Move UTF16ToASCII, remove WideToASCII. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « content/browser/session_history_browsertest.cc ('k') | content/common/pepper_plugin_list.cc » ('j') | 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 "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"
11 #include "net/base/mime_util.h" 11 #include "net/base/mime_util.h"
12 #include "third_party/WebKit/public/platform/WebString.h" 12 #include "third_party/WebKit/public/platform/WebString.h"
13 13
14 using blink::WebString; 14 using blink::WebString;
15 using blink::WebMimeRegistry; 15 using blink::WebMimeRegistry;
16 16
17 namespace content { 17 namespace content {
18 18
19 //static 19 //static
20 std::string SimpleWebMimeRegistryImpl::ToASCIIOrEmpty(const WebString& string) { 20 std::string SimpleWebMimeRegistryImpl::ToASCIIOrEmpty(const WebString& string) {
21 return IsStringASCII(string) ? UTF16ToASCII(string) : std::string(); 21 return IsStringASCII(string) ? base::UTF16ToASCII(string) : std::string();
22 } 22 }
23 23
24 WebMimeRegistry::SupportsType SimpleWebMimeRegistryImpl::supportsMIMEType( 24 WebMimeRegistry::SupportsType SimpleWebMimeRegistryImpl::supportsMIMEType(
25 const WebString& mime_type) { 25 const WebString& mime_type) {
26 return net::IsSupportedMimeType(ToASCIIOrEmpty(mime_type)) ? 26 return net::IsSupportedMimeType(ToASCIIOrEmpty(mime_type)) ?
27 WebMimeRegistry::IsSupported : WebMimeRegistry::IsNotSupported; 27 WebMimeRegistry::IsSupported : WebMimeRegistry::IsNotSupported;
28 } 28 }
29 29
30 WebMimeRegistry::SupportsType SimpleWebMimeRegistryImpl::supportsImageMIMEType( 30 WebMimeRegistry::SupportsType SimpleWebMimeRegistryImpl::supportsImageMIMEType(
31 const WebString& mime_type) { 31 const WebString& mime_type) {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 90
91 WebString SimpleWebMimeRegistryImpl::mimeTypeFromFile( 91 WebString SimpleWebMimeRegistryImpl::mimeTypeFromFile(
92 const WebString& file_path) { 92 const WebString& file_path) {
93 std::string mime_type; 93 std::string mime_type;
94 net::GetMimeTypeFromFile(base::FilePath::FromUTF16Unsafe(file_path), 94 net::GetMimeTypeFromFile(base::FilePath::FromUTF16Unsafe(file_path),
95 &mime_type); 95 &mime_type);
96 return WebString::fromUTF8(mime_type); 96 return WebString::fromUTF8(mime_type);
97 } 97 }
98 98
99 } // namespace content 99 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/session_history_browsertest.cc ('k') | content/common/pepper_plugin_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698