Commit 73022154 authored by mark@chromium.org's avatar mark@chromium.org

In-app messaging to communicate the imminent 32-bit deprecation to 32-bit-only

users.

In Google Chrome-branded builds, show an infobar at startup to users with
32-bit-only systems, and add a message to the about page for those users
advising that automatic updates will soon stop because the system
configuration is about to become unsupported.

A provision is made to change this message to an "end-of-the-line" message for
the final 32-bit-compatible build. When this switch is flipped, the autoupdate
status and promotion button on the about page will be hidden. The
"end-of-the-line" message will appear there, alongside the icon normally used
for failed updates. The startup infobar text will change at that point as
well.

No observable changes for non-branded Chromium builds (since they're not
receiving updates through this mechanism) or for users with 64-bit-capable
systems (because they're not being obsoleted).

R=arv@chromium.org, thakis@chromium.org, thakis
BUG=303280,331810,331830

Review URL: https://codereview.chromium.org/125443002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245598 0039d316-1c4b-4281-b951-d872f2087c98
parent 190d4ce6
......@@ -329,6 +329,15 @@ name="DOMAIN">$1<ex>paypal.com</ex></ph>&lt;/strong&gt;, but the server presente
<message name="IDS_ABOUT_TERMS_OF_SERVICE" desc="The terms of service label in the About box.">
Not used in Chromium. Placeholder to keep resource maps in sync. It expects one argument: $1.
</message>
<if expr="is_macosx">
<!-- Mac 32-bit deprecation -->
<message name="IDS_MAC_32_BIT_OBSOLETE_SOON" desc="A message displayed on an at-launch infobar and About (Help) page warning the user that the computer they are using is about to become unsupported.">
This computer will soon stop receiving Chromium updates because its hardware is no longer supported.
</message>
<message name="IDS_MAC_32_BIT_OBSOLETE_NOW" desc="A message displayed on an at-launch infobar and About (Help) page warning the user that the computer they are using is no longer supported.">
This computer will no longer receive Chromium updates because its hardware is no longer supported.
</message>
</if>
<message name="IDS_ACCNAME_APP" desc="The accessible name for the app menu.">
Chromium
</message>
......
......@@ -252,6 +252,15 @@ name="DOMAIN">$1<ex>paypal.com</ex></ph>&lt;/strong&gt;, but the server presente
<message name="IDS_ABOUT_TERMS_OF_SERVICE" desc="The terms of service label in the About box.">
Google Chrome <ph name="TERMS_OF_SERVICE_LINK">&lt;a target="_blank" href="$1"&gt;</ph>Terms of Service<ph name="END_TERMS_OF_SERVICE_LINK">&lt;/a&gt;</ph>
</message>
<if expr="is_macosx">
<!-- Mac 32-bit deprecation -->
<message name="IDS_MAC_32_BIT_OBSOLETE_SOON" desc="A message displayed on an at-launch infobar and About (Help) page warning the user that the computer they are using is about to become unsupported.">
This computer will soon stop receiving Google Chrome updates because its hardware is no longer supported.
</message>
<message name="IDS_MAC_32_BIT_OBSOLETE_NOW" desc="A message displayed on an at-launch infobar and About (Help) page warning the user that the computer they are using is no longer supported.">
This computer will no longer receive Google Chrome updates because its hardware is no longer supported.
</message>
</if>
<message name="IDS_ACCNAME_APP" desc="The accessible name for the app menu.">
Chrome
</message>
......
......@@ -7,8 +7,6 @@
#include <sys/mount.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <sys/sysctl.h>
#include <sys/types.h>
#include <vector>
......@@ -26,6 +24,7 @@
#include "base/threading/worker_pool.h"
#include "build/build_config.h"
#import "chrome/browser/mac/keystone_registration.h"
#include "chrome/browser/mac/obsolete_system.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_version_info.h"
#include "grit/chromium_strings.h"
......@@ -191,9 +190,6 @@ class PerformBridge : public base::RefCountedThreadSafe<PerformBridge> {
// Returns the brand file path to use for Keystone.
- (NSString*)brandFilePath;
// YES if the system's CPU is 32-bit-only, NO if it's 64-bit-capable.
- (BOOL)has32BitOnlyCPU;
// YES if no update installation has succeeded since a binary diff patch
// installation failed. This signals the need to attempt a full installer
// which does not depend on applying a patch to existing files.
......@@ -1013,19 +1009,6 @@ NSString* const kVersionKey = @"KSVersion";
}
}
- (BOOL)has32BitOnlyCPU {
#if defined(ARCH_CPU_64_BITS)
return NO;
#else // ARCH_CPU_64_BITS
int value;
size_t valueSize = sizeof(value);
if (sysctlbyname("hw.cpu64bit_capable", &value, &valueSize, NULL, 0) != 0) {
return YES;
}
return value == 0;
#endif // ARCH_CPU_64_BITS
}
- (BOOL)wantsFullInstaller {
// It's difficult to check the tag prior to Keystone registration, and
// performing registration replaces the tag. keystone_install.sh
......@@ -1057,7 +1040,7 @@ NSString* const kVersionKey = @"KSVersion";
// Info.plist, tag suffix components should only be appended to the tag
// suffix in ASCII sort order.
NSString* tagSuffix = @"";
if ([self has32BitOnlyCPU]) {
if (ObsoleteSystemMac::Has32BitOnlyCPU()) {
tagSuffix = [tagSuffix stringByAppendingString:@"-32bit"];
}
if ([self wantsFullInstaller]) {
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/mac/obsolete_system.h"
#include <sys/sysctl.h>
#include <sys/types.h>
#include "grit/chromium_strings.h"
#include "ui/base/l10n/l10n_util.h"
#if !defined(ARCH_CPU_64_BITS)
// static
bool ObsoleteSystemMac::Has32BitOnlyCPU() {
int value;
size_t valueSize = sizeof(value);
if (sysctlbyname("hw.cpu64bit_capable", &value, &valueSize, NULL, 0) != 0) {
return true;
}
return value == 0;
}
// static
base::string16 ObsoleteSystemMac::LocalizedObsoleteSystemString() {
return l10n_util::GetStringUTF16(
Is32BitEndOfTheLine() ? IDS_MAC_32_BIT_OBSOLETE_NOW :
IDS_MAC_32_BIT_OBSOLETE_SOON);
}
#endif
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_MAC_OBSOLETE_SYSTEM_H_
#define CHROME_BROWSER_MAC_OBSOLETE_SYSTEM_H_
#include "base/basictypes.h"
#include "base/strings/string16.h"
class ObsoleteSystemMac {
public:
// true if 32-bit-only systems are already considered obsolete, or if
// they'll be considered obsolete soon. Used to control whether to show
// messaging about 32-bit deprecation within the app.
static bool Is32BitObsoleteNowOrSoon() {
#if defined(GOOGLE_CHROME_BUILD)
return true;
#else
return false;
#endif
}
// true if the system's CPU is 32-bit-only, false if it's 64-bit-capable.
#if !defined(ARCH_CPU_64_BITS)
static bool Has32BitOnlyCPU();
#else
static bool Has32BitOnlyCPU() {
return false;
}
#endif
// Returns a localized string informing users that their system will either
// soon be unsupported by future versions of the application, or that they
// are already using the last version of the application that supports their
// system. Do not use the returned string unless both
// Is32BitObsoleteNowOrSoon() and Has32BitOnlyCPU() return true.
#if !defined(ARCH_CPU_64_BITS)
static base::string16 LocalizedObsoleteSystemString();
#else
static base::string16 LocalizedObsoleteSystemString() {
return base::string16();
}
#endif
// true if this is the final release that will run on 32-bit-only systems.
static bool Is32BitEndOfTheLine() {
// TODO(mark): Change to true immediately prior to the final build that
// supports 32-bit-only systems.
return false;
}
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(ObsoleteSystemMac);
};
#endif // CHROME_BROWSER_MAC_OBSOLETE_SYSTEM_H_
......@@ -67,6 +67,14 @@
<div id="update-status-message-container">
<div id="update-status-message" i18n-content="updateCheckStarted">
</div>
<if expr="is_macosx">
<div id="update-obsolete-system-container" hidden>
<span id="update-obsolete-system"
i18n-content="updateObsoleteSystem"></span>
<a i18n-values="href:updateObsoleteSystemURL"
i18n-content="learnMore" target="_blank"></a>
</div>
</if>
<div id="allowed-connection-types-message" hidden></div>
</div>
</div>
......
......@@ -246,6 +246,15 @@ cr.define('help', function() {
* @private
*/
setUpdateStatus_: function(status, message) {
if (cr.isMac &&
$('update-status-message') &&
$('update-status-message').hidden) {
// Chrome has reached the end of the line on this system. The
// update-obsolete-system message is displayed. No other auto-update
// status should be displayed.
return;
}
var channel = this.targetChannel_;
if (status == 'checking') {
this.setUpdateImage_('working');
......@@ -338,6 +347,30 @@ cr.define('help', function() {
}
},
/**
* @private
*/
setObsoleteSystem_: function(obsolete) {
if (cr.isMac && $('update-obsolete-system-container')) {
$('update-obsolete-system-container').hidden = !obsolete;
}
},
/**
* @private
*/
setObsoleteSystemEndOfTheLine_: function(endOfTheLine) {
if (cr.isMac &&
$('update-obsolete-system-container') &&
!$('update-obsolete-system-container').hidden &&
$('update-status-message')) {
$('update-status-message').hidden = endOfTheLine;
if (endOfTheLine) {
this.setUpdateImage_('failed');
}
}
},
/**
* @private
*/
......@@ -461,8 +494,12 @@ cr.define('help', function() {
HelpPage.getInstance().setPromotionState_(state);
};
HelpPage.setObsoleteOS = function(obsolete) {
HelpPage.getInstance().setObsoleteOS_(obsolete);
HelpPage.setObsoleteSystem = function(obsolete) {
HelpPage.getInstance().setObsoleteSystem_(obsolete);
};
HelpPage.setObsoleteSystemEndOfTheLine = function(endOfTheLine) {
HelpPage.getInstance().setObsoleteSystemEndOfTheLine_(endOfTheLine);
};
HelpPage.setOSVersion = function(version) {
......
......@@ -2,23 +2,32 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/startup/obsolete_os_infobar_delegate.h"
#include "chrome/browser/ui/startup/obsolete_system_infobar_delegate.h"
#include "chrome/browser/infobars/infobar.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/common/url_constants.h"
#include "content/public/browser/web_contents.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
#if defined(OS_MACOSX)
#include "chrome/browser/mac/obsolete_system.h"
#endif
#if defined(TOOLKIT_GTK)
#include <gtk/gtk.h>
#endif
// static
void ObsoleteOSInfoBarDelegate::Create(InfoBarService* infobar_service) {
#if defined(TOOLKIT_GTK)
void ObsoleteSystemInfoBarDelegate::Create(InfoBarService* infobar_service) {
#if defined(OS_MACOSX)
if (!ObsoleteSystemMac::Is32BitObsoleteNowOrSoon() ||
!ObsoleteSystemMac::Has32BitOnlyCPU()) {
return;
}
#elif defined(TOOLKIT_GTK)
// We've deprecated support for Ubuntu Lucid. Rather than attempting to
// determine whether you're using that, we instead key off the GTK version;
// this will also deprecate other distributions (including variants of Ubuntu)
......@@ -37,31 +46,40 @@ void ObsoleteOSInfoBarDelegate::Create(InfoBarService* infobar_service) {
#endif
infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar(
scoped_ptr<ConfirmInfoBarDelegate>(new ObsoleteOSInfoBarDelegate())));
scoped_ptr<ConfirmInfoBarDelegate>(new ObsoleteSystemInfoBarDelegate())));
}
ObsoleteOSInfoBarDelegate::ObsoleteOSInfoBarDelegate()
ObsoleteSystemInfoBarDelegate::ObsoleteSystemInfoBarDelegate()
: ConfirmInfoBarDelegate() {
}
ObsoleteOSInfoBarDelegate::~ObsoleteOSInfoBarDelegate() {
ObsoleteSystemInfoBarDelegate::~ObsoleteSystemInfoBarDelegate() {
}
base::string16 ObsoleteOSInfoBarDelegate::GetMessageText() const {
base::string16 ObsoleteSystemInfoBarDelegate::GetMessageText() const {
#if defined(OS_MACOSX)
return ObsoleteSystemMac::LocalizedObsoleteSystemString();
#else
return l10n_util::GetStringUTF16(IDS_SYSTEM_OBSOLETE_MESSAGE);
#endif
}
int ObsoleteOSInfoBarDelegate::GetButtons() const {
int ObsoleteSystemInfoBarDelegate::GetButtons() const {
return BUTTON_NONE;
}
base::string16 ObsoleteOSInfoBarDelegate::GetLinkText() const {
base::string16 ObsoleteSystemInfoBarDelegate::GetLinkText() const {
return l10n_util::GetStringUTF16(IDS_LEARN_MORE);
}
bool ObsoleteOSInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) {
bool ObsoleteSystemInfoBarDelegate::LinkClicked(
WindowOpenDisposition disposition) {
web_contents()->OpenURL(content::OpenURLParams(
#if defined(OS_MACOSX)
GURL(chrome::kMac32BitDeprecationURL),
#else
GURL("http://www.google.com/support/chrome/bin/answer.py?answer=95411"),
#endif
content::Referrer(),
(disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
content::PAGE_TRANSITION_LINK, false));
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_STARTUP_OBSOLETE_OS_INFOBAR_DELEGATE_H_
#define CHROME_BROWSER_UI_STARTUP_OBSOLETE_OS_INFOBAR_DELEGATE_H_
#ifndef CHROME_BROWSER_UI_STARTUP_OBSOLETE_SYSTEM_INFOBAR_DELEGATE_H_
#define CHROME_BROWSER_UI_STARTUP_OBSOLETE_SYSTEM_INFOBAR_DELEGATE_H_
#include "base/compiler_specific.h"
#include "base/strings/string16.h"
......@@ -12,24 +12,24 @@
class InfoBarService;
// An infobar that displays a message saying the system is obsolete, along with
// a "Learn More" link.
class ObsoleteOSInfoBarDelegate : public ConfirmInfoBarDelegate {
// An infobar that displays a message saying the system (OS or hardware) is
// obsolete, along with a "Learn More" link.
class ObsoleteSystemInfoBarDelegate : public ConfirmInfoBarDelegate {
public:
// Creates an obsolete OS infobar and delegate and adds the infobar to
// Creates an obsolete system infobar and delegate and adds the infobar to
// |infobar_service|.
static void Create(InfoBarService* infobar_service);
private:
ObsoleteOSInfoBarDelegate();
virtual ~ObsoleteOSInfoBarDelegate();
ObsoleteSystemInfoBarDelegate();
virtual ~ObsoleteSystemInfoBarDelegate();
virtual base::string16 GetMessageText() const OVERRIDE;
virtual int GetButtons() const OVERRIDE;
virtual base::string16 GetLinkText() const OVERRIDE;
virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE;
DISALLOW_COPY_AND_ASSIGN(ObsoleteOSInfoBarDelegate);
DISALLOW_COPY_AND_ASSIGN(ObsoleteSystemInfoBarDelegate);
};
#endif // CHROME_BROWSER_UI_STARTUP_OBSOLETE_OS_INFOBAR_DELEGATE_H_
#endif // CHROME_BROWSER_UI_STARTUP_OBSOLETE_SYSTEM_INFOBAR_DELEGATE_H_
......@@ -65,7 +65,7 @@
#include "chrome/browser/ui/startup/bad_flags_prompt.h"
#include "chrome/browser/ui/startup/default_browser_prompt.h"
#include "chrome/browser/ui/startup/google_api_keys_infobar_delegate.h"
#include "chrome/browser/ui/startup/obsolete_os_infobar_delegate.h"
#include "chrome/browser/ui/startup/obsolete_system_infobar_delegate.h"
#include "chrome/browser/ui/startup/session_crashed_infobar_delegate.h"
#include "chrome/browser/ui/startup/startup_browser_creator.h"
#include "chrome/browser/ui/tabs/pinned_tab_codec.h"
......@@ -905,7 +905,7 @@ void StartupBrowserCreatorImpl::AddInfoBarsIfNecessary(
chrome::ShowBadFlagsPrompt(browser);
GoogleApiKeysInfoBarDelegate::Create(InfoBarService::FromWebContents(
browser->tab_strip_model()->GetActiveWebContents()));
ObsoleteOSInfoBarDelegate::Create(InfoBarService::FromWebContents(
ObsoleteSystemInfoBarDelegate::Create(InfoBarService::FromWebContents(
browser->tab_strip_model()->GetActiveWebContents()));
#if !defined(OS_CHROMEOS)
......
......@@ -38,6 +38,10 @@
#include "v8/include/v8.h"
#include "webkit/common/user_agent/user_agent_util.h"
#if defined(OS_MACOSX)
#include "chrome/browser/mac/obsolete_system.h"
#endif
#if defined(OS_CHROMEOS)
#include "base/files/file_util_proxy.h"
#include "base/i18n/time_formatting.h"
......@@ -215,6 +219,13 @@ void HelpHandler::GetLocalizedValues(content::WebUIDataSource* source) {
l10n_util::GetStringUTF16(resources[i].ids));
}
#if defined(OS_MACOSX)
source->AddString("updateObsoleteSystem",
ObsoleteSystemMac::LocalizedObsoleteSystemString());
source->AddString("updateObsoleteSystemURL",
chrome::kMac32BitDeprecationURL);
#endif
source->AddString(
"browserVersion",
l10n_util::GetStringFUTF16(IDS_ABOUT_PRODUCT_VERSION,
......@@ -344,6 +355,17 @@ void HelpHandler::OnPageLoaded(const base::ListValue* args) {
#endif
);
#if defined(OS_MACOSX)
web_ui()->CallJavascriptFunction(
"help.HelpPage.setObsoleteSystem",
base::FundamentalValue(ObsoleteSystemMac::Is32BitObsoleteNowOrSoon() &&
ObsoleteSystemMac::Has32BitOnlyCPU()));
web_ui()->CallJavascriptFunction(
"help.HelpPage.setObsoleteSystemEndOfTheLine",
base::FundamentalValue(ObsoleteSystemMac::Is32BitObsoleteNowOrSoon() &&
ObsoleteSystemMac::Is32BitEndOfTheLine()));
#endif
#if defined(OS_CHROMEOS)
web_ui()->CallJavascriptFunction(
"help.HelpPage.updateIsEnterpriseManaged",
......
......@@ -8,6 +8,7 @@
#include "base/bind_helpers.h"
#include "chrome/browser/lifetime/application_lifetime.h"
#import "chrome/browser/mac/keystone_glue.h"
#include "chrome/browser/mac/obsolete_system.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
......@@ -223,6 +224,13 @@ void VersionUpdaterMac::UpdateStatus(NSDictionary* dictionary) {
}
void VersionUpdaterMac::UpdateShowPromoteButton() {
if (ObsoleteSystemMac::Has32BitOnlyCPU() &&
ObsoleteSystemMac::Is32BitEndOfTheLine()) {
// Promotion is moot upon reaching the end of the line.
show_promote_button_ = false;
return;
}
KeystoneGlue* keystone_glue = [KeystoneGlue defaultKeystoneGlue];
AutoupdateStatus recent_status = [keystone_glue recentStatus];
if (recent_status == kAutoupdateRegistering ||
......
......@@ -1008,6 +1008,8 @@
'browser/mac/keystone_registration.mm',
'browser/mac/master_prefs.h',
'browser/mac/master_prefs.mm',
'browser/mac/obsolete_system.cc',
'browser/mac/obsolete_system.h',
'browser/mac/relauncher.cc',
'browser/mac/relauncher.h',
'browser/mac/security_wrappers.cc',
......
......@@ -1567,8 +1567,8 @@
'browser/ui/startup/default_browser_prompt_win.cc',
'browser/ui/startup/google_api_keys_infobar_delegate.cc',
'browser/ui/startup/google_api_keys_infobar_delegate.h',
'browser/ui/startup/obsolete_os_infobar_delegate.cc',
'browser/ui/startup/obsolete_os_infobar_delegate.h',
'browser/ui/startup/obsolete_system_infobar_delegate.cc',
'browser/ui/startup/obsolete_system_infobar_delegate.h',
'browser/ui/startup/session_crashed_infobar_delegate.cc',
'browser/ui/startup/session_crashed_infobar_delegate.h',
'browser/ui/startup/startup_browser_creator.cc',
......
......@@ -671,4 +671,13 @@ const char kLanguageSettingsLearnMoreUrl[] =
"https://support.google.com/chrome/topic/1678461";
#endif
#if defined(OS_MACOSX)
const char kMac32BitDeprecationURL[] =
#if !defined(ARCH_CPU_64_BITS)
"https://support.google.com/chrome/?p=ui_mac_32bit_support";
#else
"";
#endif
#endif
} // namespace chrome
......@@ -506,6 +506,11 @@ extern const char kMediaAccessLearnMoreUrl[];
// The URL for the "Learn more" link in the language settings.
extern const char kLanguageSettingsLearnMoreUrl[];
#if defined(OS_MACOSX)
// The URL for the 32-bit Mac deprecation help center article
extern const char kMac32BitDeprecationURL[];
#endif
} // namespace chrome
#endif // CHROME_COMMON_URL_CONSTANTS_H_
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