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

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

Issue 151023002: Move the rest of webkit/glue into content/common (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rm webkit_glue.gyp Created 6 years, 10 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/child/simple_webmimeregistry_impl.h ('k') | content/child/webfileutilities_impl.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "webkit/glue/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 webkit_glue { 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) ? 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;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 } 81 }
82 82
83 WebString SimpleWebMimeRegistryImpl::mimeTypeFromFile( 83 WebString SimpleWebMimeRegistryImpl::mimeTypeFromFile(
84 const WebString& file_path) { 84 const WebString& file_path) {
85 std::string mime_type; 85 std::string mime_type;
86 net::GetMimeTypeFromFile(base::FilePath::FromUTF16Unsafe(file_path), 86 net::GetMimeTypeFromFile(base::FilePath::FromUTF16Unsafe(file_path),
87 &mime_type); 87 &mime_type);
88 return WebString::fromUTF8(mime_type); 88 return WebString::fromUTF8(mime_type);
89 } 89 }
90 90
91 } // namespace webkit_glue 91 } // namespace content
OLDNEW
« no previous file with comments | « content/child/simple_webmimeregistry_impl.h ('k') | content/child/webfileutilities_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698