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

Side by Side Diff: net/base/platform_mime_util_win.cc

Issue 830002: win: string_util.h -> utf_string_conversions.h fix. (Closed)
Patch Set: Don't remove utf_string_conversions.h from string_util.h just yet Created 10 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
« no previous file with comments | « net/base/net_util_win.cc ('k') | net/base/x509_certificate_win.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 (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <string> 5 #include <string>
6 6
7 #include "net/base/platform_mime_util.h" 7 #include "net/base/platform_mime_util.h"
8 8
9 #include "base/registry.h" 9 #include "base/registry.h"
10 #include "base/string_util.h" 10 #include "base/utf_string_conversions.h"
11 11
12 namespace net { 12 namespace net {
13 13
14 bool PlatformMimeUtil::GetPlatformMimeTypeFromExtension( 14 bool PlatformMimeUtil::GetPlatformMimeTypeFromExtension(
15 const FilePath::StringType& ext, std::string* result) const { 15 const FilePath::StringType& ext, std::string* result) const {
16 // check windows registry for file extension's mime type (registry key 16 // check windows registry for file extension's mime type (registry key
17 // names are not case-sensitive). 17 // names are not case-sensitive).
18 std::wstring value, key = L"." + ext; 18 std::wstring value, key = L"." + ext;
19 RegKey(HKEY_CLASSES_ROOT, key.c_str()).ReadValue(L"Content Type", &value); 19 RegKey(HKEY_CLASSES_ROOT, key.c_str()).ReadValue(L"Content Type", &value);
20 if (!value.empty()) { 20 if (!value.empty()) {
(...skipping 10 matching lines...) Expand all
31 return false; 31 return false;
32 32
33 // Strip off the leading dot, this should always be the case. 33 // Strip off the leading dot, this should always be the case.
34 if (!ext->empty() && ext->at(0) == L'.') 34 if (!ext->empty() && ext->at(0) == L'.')
35 ext->erase(ext->begin()); 35 ext->erase(ext->begin());
36 36
37 return true; 37 return true;
38 } 38 }
39 39
40 } // namespace net 40 } // namespace net
OLDNEW
« no previous file with comments | « net/base/net_util_win.cc ('k') | net/base/x509_certificate_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698