Commit f0759378 authored by Victor Costan's avatar Victor Costan Committed by Commit Bot

chrome: Add obsolete computer notice for x86 CPUs without SSE3.

Bug: 1123353
Change-Id: I2e9f30e3b847d4c3592f40fae2053a8434b248df
Tested: Manually, by making IsObsoleteCpu() always return true.
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2427631
Commit-Queue: Victor Costan <pwnall@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810489}
parent a9bed1a2
......@@ -293,6 +293,9 @@ If you update this file, be sure also to update google_chrome_strings.grd. -->
<message name="IDS_ABOUT_TERMS_OF_SERVICE" desc="The terms of service label in the About box." translateable="false">
Not used in Chromium. Placeholder to keep resource maps in sync.
</message>
<message name="IDS_CPU_X86_SSE2_OBSOLETE_SOON" desc="A message displayed on an at-launch infobar and About (Help) page warning the user that the computer they are using will soon be or is already unsupported.">
This computer will soon stop receiving Chromium updates because its hardware is no longer supported.
</message>
<if expr="is_macosx">
<message name="IDS_MAC_10_10_OBSOLETE_SOON" desc="A message displayed on an at-launch infobar and About (Help) page warning the user that the OS version they are using will soon be or is already unsupported.">
To get future Chromium updates, you'll need OS X 10.11 or later. This computer is using OS X 10.10.
......
a0d88718e2f147504d28f0c417348a4d70db0aef
\ No newline at end of file
......@@ -299,6 +299,9 @@ chromium_strings.grd. -->
<message name="IDS_ABOUT_TERMS_OF_SERVICE" desc="The terms of service label in the About box.">
Terms of Service
</message>
<message name="IDS_CPU_X86_SSE2_OBSOLETE_SOON" desc="A message displayed on an at-launch infobar and About (Help) page warning the user that the computer they are using will soon be or is already unsupported.">
This computer will soon stop receiving Google Chrome updates because its hardware is no longer supported.
</message>
<if expr="is_macosx">
<message name="IDS_MAC_10_10_OBSOLETE_SOON" desc="A message displayed on an at-launch infobar and About (Help) page warning the user that the OS version they are using will soon be or is already unsupported.">
To get future Google Chrome updates, you'll need OS X 10.11 or later. This computer is using OS X 10.10.
......
3223a40ccdf0dc64119f047104c5e47b889d2bc9
\ No newline at end of file
......@@ -4,22 +4,41 @@
#include "chrome/browser/obsolete_system/obsolete_system.h"
#include "base/cpu.h"
#include "build/build_config.h"
#include "chrome/common/chrome_version.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/chromium_strings.h"
#include "ui/base/l10n/l10n_util.h"
namespace {
bool IsObsoleteCpu() {
#if defined(ARCH_CPU_X86_FAMILY)
return !base::CPU().has_sse3();
#else
return false;
#endif
}
} // namespace
// static
bool ObsoleteSystem::IsObsoleteNowOrSoon() {
return false;
return IsObsoleteCpu();
}
// static
base::string16 ObsoleteSystem::LocalizedObsoleteString() {
return base::string16();
return l10n_util::GetStringUTF16(IDS_CPU_X86_SSE2_OBSOLETE_SOON);
}
// static
bool ObsoleteSystem::IsEndOfTheLine() {
return false;
return CHROME_VERSION_MAJOR >= 88;
}
// static
const char* ObsoleteSystem::GetLinkURL() {
return "";
return chrome::kCpuX86Sse2ObsoleteURL;
}
......@@ -4,14 +4,18 @@
#include "chrome/browser/obsolete_system/obsolete_system.h"
#include "base/cpu.h"
#include "base/system/sys_info.h"
#include "build/build_config.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/chrome_version.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/chromium_strings.h"
#include "ui/base/l10n/l10n_util.h"
// static
bool ObsoleteSystem::IsObsoleteNowOrSoon() {
namespace {
bool IsObsoleteOsVersion() {
// Use base::SysInfo::OperatingSystemVersionNumbers() here rather than the
// preferred base::mac::IsOS*() function because the IsOS functions for
// obsolete system versions are removed to help prevent obsolete code from
......@@ -23,17 +27,37 @@ bool ObsoleteSystem::IsObsoleteNowOrSoon() {
base::FeatureList::IsEnabled(features::kShow10_10ObsoleteInfobar);
}
bool IsObsoleteCpu() {
#if defined(ARCH_CPU_X86_FAMILY)
return !base::CPU().has_sse3();
#else
return false;
#endif
}
} // namespace
// static
bool ObsoleteSystem::IsObsoleteNowOrSoon() {
return IsObsoleteCpu() || IsObsoleteOsVersion();
}
// static
base::string16 ObsoleteSystem::LocalizedObsoleteString() {
return l10n_util::GetStringUTF16(IDS_MAC_10_10_OBSOLETE_SOON);
// We check for an obsolete CPU first so that we don't nudge users through
// an OS upgrade, only to find out that they need a new computer anyway.
return IsObsoleteCpu()
? l10n_util::GetStringUTF16(IDS_CPU_X86_SSE2_OBSOLETE_SOON)
: l10n_util::GetStringUTF16(IDS_MAC_10_10_OBSOLETE_SOON);
}
// static
bool ObsoleteSystem::IsEndOfTheLine() {
return true;
return IsObsoleteCpu() ? CHROME_VERSION_MAJOR >= 88 : true;
}
// static
const char* ObsoleteSystem::GetLinkURL() {
return chrome::kMac10_10_ObsoleteURL;
return IsObsoleteCpu() ? chrome::kCpuX86Sse2ObsoleteURL
: chrome::kMac10_10_ObsoleteURL;
}
......@@ -4,27 +4,51 @@
#include "chrome/browser/obsolete_system/obsolete_system.h"
#include "base/cpu.h"
#include "base/win/windows_version.h"
#include "build/build_config.h"
#include "chrome/common/chrome_version.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/chromium_strings.h"
#include "ui/base/l10n/l10n_util.h"
namespace {
bool IsObsoleteOsVersion() {
return base::win::GetVersion() < base::win::Version::WIN7;
}
bool IsObsoleteCpu() {
#if defined(ARCH_CPU_X86_FAMILY)
return !base::CPU().has_sse3();
#else
return false;
#endif
}
} // namespace
// static
bool ObsoleteSystem::IsObsoleteNowOrSoon() {
return base::win::GetVersion() < base::win::Version::WIN7;
return IsObsoleteCpu() || IsObsoleteOsVersion();
}
// static
base::string16 ObsoleteSystem::LocalizedObsoleteString() {
return l10n_util::GetStringUTF16(IDS_WIN_XP_VISTA_OBSOLETE);
// We check for an obsolete CPU first so that we don't nudge users through
// an OS upgrade, only to find out that they need a new computer anyway.
return IsObsoleteCpu()
? l10n_util::GetStringUTF16(IDS_CPU_X86_SSE2_OBSOLETE_SOON)
: l10n_util::GetStringUTF16(IDS_WIN_XP_VISTA_OBSOLETE);
}
// static
bool ObsoleteSystem::IsEndOfTheLine() {
return true;
return IsObsoleteCpu() ? CHROME_VERSION_MAJOR >= 88 : true;
}
// static
const char* ObsoleteSystem::GetLinkURL() {
return chrome::kWindowsXPVistaDeprecationURL;
return IsObsoleteCpu() ? chrome::kCpuX86Sse2ObsoleteURL
: chrome::kWindowsXPVistaDeprecationURL;
}
......@@ -117,6 +117,9 @@ const char kContentSettingsExceptionsLearnMoreURL[] =
const char kCookiesSettingsHelpCenterURL[] =
"https://support.google.com/chrome?p=cpn_cookies";
const char kCpuX86Sse2ObsoleteURL[] =
"https://support.google.com/chrome/?p=unsupported_cpu";
const char kCrashReasonURL[] =
#if defined(OS_CHROMEOS)
"https://support.google.com/chromebook/?p=e_awsnap";
......
......@@ -127,6 +127,9 @@ extern const char kContentSettingsExceptionsLearnMoreURL[];
// "Learn more" URL for cookies.
extern const char kCookiesSettingsHelpCenterURL[];
// The URL for the "learn more" link on the SSE2 obsolescence infobar.
extern const char kCpuX86Sse2ObsoleteURL[];
// "Learn more" URL for "Aw snap" page when showing "Reload" button.
extern const char kCrashReasonURL[];
......
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