diff options
author | cpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-07 03:28:44 +0000 |
---|---|---|
committer | cpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-07 03:28:44 +0000 |
commit | e562de106eeab2667eeb6922ddf2d771a0efa55d (patch) | |
tree | 75027c5dfd72ac1ab1bc49333aaa5db4930f42c0 /chrome | |
parent | f83b6736a3d555987680243662698571d875875e (diff) | |
download | chromium_src-e562de106eeab2667eeb6922ddf2d771a0efa55d.zip chromium_src-e562de106eeab2667eeb6922ddf2d771a0efa55d.tar.gz chromium_src-e562de106eeab2667eeb6922ddf2d771a0efa55d.tar.bz2 |
Potential fix for FF importing issue
- Select the highest FF version, not just the the HCKU one.
- I don't have a repro case, it is a blind fix
Seems like leftovers of old FF installs in HCKU are tripping us, that
is my guess, now we would find FF3 in HKLM.
BUG=3109
Review URL: http://codereview.chromium.org/9675
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4960 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/importer/firefox_importer_utils.cc | 6 | ||||
-rw-r--r-- | chrome/browser/importer/firefox_importer_utils.h | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/chrome/browser/importer/firefox_importer_utils.cc b/chrome/browser/importer/firefox_importer_utils.cc index 5796e10..61b4b5b 100644 --- a/chrome/browser/importer/firefox_importer_utils.cc +++ b/chrome/browser/importer/firefox_importer_utils.cc @@ -4,6 +4,7 @@ #include "chrome/browser/importer/firefox_importer_utils.h" +#include <algorithm> #include <shlobj.h> #include "base/file_util.h" @@ -78,6 +79,7 @@ class SetDllDirectoryCaller { int GetCurrentFirefoxMajorVersion() { TCHAR ver_buffer[128]; DWORD ver_buffer_length = sizeof(ver_buffer); + int highest_version = 0; // When installing Firefox with admin account, the product keys will be // written under HKLM\Mozilla. Otherwise it the keys will be written under // HKCU\Mozilla. @@ -87,9 +89,9 @@ int GetCurrentFirefoxMajorVersion() { L"CurrentVersion", ver_buffer, &ver_buffer_length); if (!result) continue; - return _wtoi(ver_buffer); + highest_version = std::max(highest_version, _wtoi(ver_buffer)); } - return 0; + return highest_version; } std::wstring GetProfilesINI() { diff --git a/chrome/browser/importer/firefox_importer_utils.h b/chrome/browser/importer/firefox_importer_utils.h index f69a27d..165ce2d 100644 --- a/chrome/browser/importer/firefox_importer_utils.h +++ b/chrome/browser/importer/firefox_importer_utils.h @@ -13,7 +13,8 @@ class TemplateURL; // Detects which version of Firefox is installed. Returns its // major version, and drops the minor version. Returns 0 if -// failed. +// failed. If there are indicators of both FF2 and FF3 it is +// biased to return the biggest version. int GetCurrentFirefoxMajorVersion(); // Gets the full path of the profiles.ini file. This file records |