Commit 3aeff323 authored by tfarina@chromium.org's avatar tfarina@chromium.org

importer: Convert two wstrings to string16 in GetFirefoxInstallPathFromRegistry().

BUG=43460
R=mirandac@chromium.org

Review URL: http://codereview.chromium.org/8772026

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112698 0039d316-1c4b-4281-b951-d872f2087c98
parent dd483706
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <shlobj.h> #include <shlobj.h>
#include "base/file_util.h" #include "base/file_util.h"
#include "base/string16.h"
#include "base/win/registry.h" #include "base/win/registry.h"
// NOTE: Keep these in order since we need test all those paths according // NOTE: Keep these in order since we need test all those paths according
...@@ -42,7 +43,7 @@ int GetCurrentFirefoxMajorVersionFromRegistry() { ...@@ -42,7 +43,7 @@ int GetCurrentFirefoxMajorVersionFromRegistry() {
FilePath GetFirefoxInstallPathFromRegistry() { FilePath GetFirefoxInstallPathFromRegistry() {
// Detects the path that Firefox is installed in. // Detects the path that Firefox is installed in.
std::wstring registry_path = L"Software\\Mozilla\\Mozilla Firefox"; string16 registry_path = L"Software\\Mozilla\\Mozilla Firefox";
wchar_t buffer[MAX_PATH]; wchar_t buffer[MAX_PATH];
DWORD buffer_length = sizeof(buffer); DWORD buffer_length = sizeof(buffer);
base::win::RegKey reg_key(HKEY_LOCAL_MACHINE, registry_path.c_str(), base::win::RegKey reg_key(HKEY_LOCAL_MACHINE, registry_path.c_str(),
...@@ -52,7 +53,7 @@ FilePath GetFirefoxInstallPathFromRegistry() { ...@@ -52,7 +53,7 @@ FilePath GetFirefoxInstallPathFromRegistry() {
if (result != ERROR_SUCCESS) if (result != ERROR_SUCCESS)
return FilePath(); return FilePath();
registry_path += L"\\" + std::wstring(buffer) + L"\\Main"; registry_path += L"\\" + string16(buffer) + L"\\Main";
buffer_length = sizeof(buffer); buffer_length = sizeof(buffer);
base::win::RegKey reg_key_directory(HKEY_LOCAL_MACHINE, base::win::RegKey reg_key_directory(HKEY_LOCAL_MACHINE,
registry_path.c_str(), KEY_READ); registry_path.c_str(), KEY_READ);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment