diff options
author | mmentovai@google.com <mmentovai@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-02 18:13:34 +0000 |
---|---|---|
committer | mmentovai@google.com <mmentovai@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-02 18:13:34 +0000 |
commit | 844cbe038fca95d8a5406f895704076c402e4e29 (patch) | |
tree | 15d719337cb5541af0b364ada93fc1e166533026 /net/base/platform_mime_util_win.cc | |
parent | 368e2490bd7ac1ffeee85d246b98144ea6d92591 (diff) | |
download | chromium_src-844cbe038fca95d8a5406f895704076c402e4e29.zip chromium_src-844cbe038fca95d8a5406f895704076c402e4e29.tar.gz chromium_src-844cbe038fca95d8a5406f895704076c402e4e29.tar.bz2 |
Normalize newlines to LF in net
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1647 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/platform_mime_util_win.cc')
-rw-r--r-- | net/base/platform_mime_util_win.cc | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/net/base/platform_mime_util_win.cc b/net/base/platform_mime_util_win.cc index 9b62f30..c0219fc 100644 --- a/net/base/platform_mime_util_win.cc +++ b/net/base/platform_mime_util_win.cc @@ -1,34 +1,34 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <string>
-
-#include "net/base/platform_mime_util.h"
-
-#include "base/registry.h"
-#include "base/string_util.h"
-
-namespace net {
-
-bool PlatformMimeUtil::GetPlatformMimeTypeFromExtension(
- const std::wstring& ext, std::string* result) const {
- // check windows registry for file extension's mime type (registry key
- // names are not case-sensitive).
- std::wstring value, key = L"." + ext;
- RegKey(HKEY_CLASSES_ROOT, key.c_str()).ReadValue(L"Content Type", &value);
- if (!value.empty()) {
- *result = WideToUTF8(value);
- return true;
- }
- return false;
-}
-
-bool PlatformMimeUtil::GetPreferredExtensionForMimeType(
- const std::string& mime_type, std::wstring* ext) const {
- std::wstring key(L"MIME\\Database\\Content Type\\" + UTF8ToWide(mime_type));
- return RegKey(HKEY_CLASSES_ROOT, key.c_str()).ReadValue(L"Extension", ext);
-}
-
-} // namespace net
-
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include <string> + +#include "net/base/platform_mime_util.h" + +#include "base/registry.h" +#include "base/string_util.h" + +namespace net { + +bool PlatformMimeUtil::GetPlatformMimeTypeFromExtension( + const std::wstring& ext, std::string* result) const { + // check windows registry for file extension's mime type (registry key + // names are not case-sensitive). + std::wstring value, key = L"." + ext; + RegKey(HKEY_CLASSES_ROOT, key.c_str()).ReadValue(L"Content Type", &value); + if (!value.empty()) { + *result = WideToUTF8(value); + return true; + } + return false; +} + +bool PlatformMimeUtil::GetPreferredExtensionForMimeType( + const std::string& mime_type, std::wstring* ext) const { + std::wstring key(L"MIME\\Database\\Content Type\\" + UTF8ToWide(mime_type)); + return RegKey(HKEY_CLASSES_ROOT, key.c_str()).ReadValue(L"Extension", ext); +} + +} // namespace net + |