summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authornsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-25 20:26:44 +0000
committernsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-25 20:26:44 +0000
commit309c8ff514d506364567d9e6095a295b8d5c3d3e (patch)
treeeed57b5e9e9b725c02d665472b839b305227f04a /chrome/browser
parent47041caea97f2ffe6ecd5963684d3b57f7dde14d (diff)
downloadchromium_src-309c8ff514d506364567d9e6095a295b8d5c3d3e.zip
chromium_src-309c8ff514d506364567d9e6095a295b8d5c3d3e.tar.gz
chromium_src-309c8ff514d506364567d9e6095a295b8d5c3d3e.tar.bz2
Fix all places where we used the GetWinVersion function
incorrectly. bug:7802 Review URL: http://codereview.chromium.org/28128 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10366 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/browser_main_win.cc5
-rw-r--r--chrome/browser/google_update.cc2
-rw-r--r--chrome/browser/importer/ie_importer.cc2
-rw-r--r--chrome/browser/sandbox_policy.cc2
-rw-r--r--chrome/browser/shell_integration.cc4
-rw-r--r--chrome/browser/views/about_chrome_view.cc3
6 files changed, 10 insertions, 8 deletions
diff --git a/chrome/browser/browser_main_win.cc b/chrome/browser/browser_main_win.cc
index b6eec50..a1c5056 100644
--- a/chrome/browser/browser_main_win.cc
+++ b/chrome/browser/browser_main_win.cc
@@ -113,9 +113,10 @@ void PrepareRestartOnCrashEnviroment(const CommandLine &parsed_command_line) {
int HandleIconsCommands(const CommandLine &parsed_command_line) {
if (parsed_command_line.HasSwitch(switches::kHideIcons)) {
std::wstring cp_applet;
- if (win_util::GetWinVersion() == win_util::WINVERSION_VISTA) {
+ win_util::WinVersion version = win_util::GetWinVersion();
+ if (version >= win_util::WINVERSION_VISTA) {
cp_applet.assign(L"Programs and Features"); // Windows Vista and later.
- } else if (win_util::GetWinVersion() == win_util::WINVERSION_XP) {
+ } else if (version >= win_util::WINVERSION_XP) {
cp_applet.assign(L"Add/Remove Programs"); // Windows XP.
} else {
return ResultCodes::UNSUPPORTED_PARAM; // Not supported
diff --git a/chrome/browser/google_update.cc b/chrome/browser/google_update.cc
index da82ae5..17f30b3 100644
--- a/chrome/browser/google_update.cc
+++ b/chrome/browser/google_update.cc
@@ -57,7 +57,7 @@ HRESULT CoCreateInstanceAsAdmin(REFCLSID class_id, REFIID interface_id,
// For Vista we need to instantiate the COM server via the elevation
// moniker. This ensures that the UAC dialog shows up.
- if (win_util::GetWinVersion() == win_util::WINVERSION_VISTA) {
+ if (win_util::GetWinVersion() >= win_util::WINVERSION_VISTA) {
wchar_t class_id_as_string[MAX_PATH] = {0};
StringFromGUID2(class_id, class_id_as_string,
arraysize(class_id_as_string));
diff --git a/chrome/browser/importer/ie_importer.cc b/chrome/browser/importer/ie_importer.cc
index 36b6cd7..0d0e3e7 100644
--- a/chrome/browser/importer/ie_importer.cc
+++ b/chrome/browser/importer/ie_importer.cc
@@ -451,7 +451,7 @@ bool IEImporter::GetFavoritesInfo(IEImporter::FavoritesInfo *info) {
// is not recording in Vista's registry. So in Vista, we assume the Links
// folder is under Favorites folder since it looks like there is not name
// different in every language version of Windows Vista.
- if (win_util::GetWinVersion() != win_util::WINVERSION_VISTA) {
+ if (win_util::GetWinVersion() < win_util::WINVERSION_VISTA) {
// The Link folder name is stored in the registry.
DWORD buffer_length = sizeof(buffer);
if (!ReadFromRegistry(HKEY_CURRENT_USER,
diff --git a/chrome/browser/sandbox_policy.cc b/chrome/browser/sandbox_policy.cc
index 5e0e999..8d39650 100644
--- a/chrome/browser/sandbox_policy.cc
+++ b/chrome/browser/sandbox_policy.cc
@@ -282,7 +282,7 @@ bool ApplyPolicyForUntrustedPlugin(sandbox::TargetPolicy* policy) {
policy))
return false;
- if (win_util::GetWinVersion() == win_util::WINVERSION_VISTA) {
+ if (win_util::GetWinVersion() >= win_util::WINVERSION_VISTA) {
if (!AddKeyAndSubkeys(L"HKEY_CURRENT_USER\\SOFTWARE\\AppDataLow",
sandbox::TargetPolicy::REG_ALLOW_ANY,
policy))
diff --git a/chrome/browser/shell_integration.cc b/chrome/browser/shell_integration.cc
index f5a9a34..c38ae76 100644
--- a/chrome/browser/shell_integration.cc
+++ b/chrome/browser/shell_integration.cc
@@ -69,7 +69,7 @@ bool ShellIntegration::IsDefaultBrowser() {
// to show up in Add/Remove programs for us.
const std::wstring kChromeProtocols[] = {L"http", L"https"};
- if (win_util::GetWinVersion() == win_util::WINVERSION_VISTA) {
+ if (win_util::GetWinVersion() >= win_util::WINVERSION_VISTA) {
IApplicationAssociationRegistration* pAAR;
HRESULT hr = CoCreateInstance(CLSID_ApplicationAssociationRegistration,
NULL, CLSCTX_INPROC, __uuidof(IApplicationAssociationRegistration),
@@ -130,7 +130,7 @@ bool ShellIntegration::IsDefaultBrowser() {
// is false.
bool ShellIntegration::IsFirefoxDefaultBrowser() {
bool ff_default = false;
- if (win_util::GetWinVersion() == win_util::WINVERSION_VISTA) {
+ if (win_util::GetWinVersion() >= win_util::WINVERSION_VISTA) {
std::wstring app_cmd;
RegKey key(HKEY_CURRENT_USER, ShellUtil::kRegVistaUrlPrefs, KEY_READ);
if (key.Valid() && key.ReadValue(L"Progid", &app_cmd) &&
diff --git a/chrome/browser/views/about_chrome_view.cc b/chrome/browser/views/about_chrome_view.cc
index 347e717a..b6e4b3d 100644
--- a/chrome/browser/views/about_chrome_view.cc
+++ b/chrome/browser/views/about_chrome_view.cc
@@ -584,7 +584,8 @@ void AboutChromeView::ViewHierarchyChanged(bool is_add,
if (win_util::UserAccountControlIsEnabled() ||
win_util::GetWinVersion() == win_util::WINVERSION_XP ||
(win_util::GetWinVersion() == win_util::WINVERSION_VISTA &&
- service_pack_major >= 1)) {
+ service_pack_major >= 1) ||
+ win_util::GetWinVersion() > win_util::WINVERSION_VISTA) {
UpdateStatus(UPGRADE_CHECK_STARTED, GOOGLE_UPDATE_NO_ERROR);
google_updater_->CheckForUpdate(false); // false=don't upgrade yet.
}