| Index: net/base/platform_mime_util_win.cc
|
| diff --git a/net/base/platform_mime_util_win.cc b/net/base/platform_mime_util_win.cc
|
| index fcac48faab53e3c10e0b12555a2c42edf720e444..9aaf609575872c41fdc6a79a01508bd3907d7cd0 100644
|
| --- a/net/base/platform_mime_util_win.cc
|
| +++ b/net/base/platform_mime_util_win.cc
|
| @@ -12,12 +12,13 @@
|
| namespace net {
|
|
|
| bool PlatformMimeUtil::GetPlatformMimeTypeFromExtension(
|
| - const base::FilePath::StringType& ext, std::string* result) const {
|
| + const base::FilePath::StringType& 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;
|
| - base::win::RegKey(HKEY_CLASSES_ROOT, key.c_str(), KEY_READ).ReadValue(
|
| - L"Content Type", &value);
|
| + base::win::RegKey(HKEY_CLASSES_ROOT, key.c_str(), KEY_READ)
|
| + .ReadValue(L"Content Type", &value);
|
| if (!value.empty()) {
|
| *result = base::WideToUTF8(value);
|
| return true;
|
| @@ -26,11 +27,12 @@ bool PlatformMimeUtil::GetPlatformMimeTypeFromExtension(
|
| }
|
|
|
| bool PlatformMimeUtil::GetPreferredExtensionForMimeType(
|
| - const std::string& mime_type, base::FilePath::StringType* ext) const {
|
| - std::wstring key(
|
| - L"MIME\\Database\\Content Type\\" + base::UTF8ToWide(mime_type));
|
| - if (base::win::RegKey(HKEY_CLASSES_ROOT, key.c_str(), KEY_READ).ReadValue(
|
| - L"Extension", ext) != ERROR_SUCCESS) {
|
| + const std::string& mime_type,
|
| + base::FilePath::StringType* ext) const {
|
| + std::wstring key(L"MIME\\Database\\Content Type\\" +
|
| + base::UTF8ToWide(mime_type));
|
| + if (base::win::RegKey(HKEY_CLASSES_ROOT, key.c_str(), KEY_READ)
|
| + .ReadValue(L"Extension", ext) != ERROR_SUCCESS) {
|
| return false;
|
| }
|
| // Strip off the leading dot, this should always be the case.
|
|
|