summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-26 13:09:33 +0000
committerhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-26 13:09:33 +0000
commit60cf3e73195dc18482e67e58214e797a1cdc3b11 (patch)
tree458eee448a4027a45ac1a124d512b060e7592514
parent75b99eb6f4707d34457edc5293372478c2275029 (diff)
downloadchromium_src-60cf3e73195dc18482e67e58214e797a1cdc3b11.zip
chromium_src-60cf3e73195dc18482e67e58214e797a1cdc3b11.tar.gz
chromium_src-60cf3e73195dc18482e67e58214e797a1cdc3b11.tar.bz2
Change wrench menu icon's accessible name to indicate available update
BUG=chromium-os:17585 TEST=Enable accessibility feature and focus on the wrench menu by pressing ALT when upgrade is available. Ensure that it speaks "update is available." Review URL: http://codereview.chromium.org/8394031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107338 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/generated_resources.grd3
-rw-r--r--chrome/browser/ui/views/toolbar_view.cc13
-rw-r--r--chrome/browser/ui/views/toolbar_view.h4
3 files changed, 15 insertions, 5 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index a833d64..b7a5151 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -5252,6 +5252,9 @@ Keep your key file in a safe place. You will need it to create new versions of y
<message name="IDS_ACCESSIBLE_INCOGNITO_WINDOW_TITLE_FORMAT" desc="The format for the accessible title of an incognito window">
<ph name="WINDOW_TITLE">$1</ph> (Incognito)
</message>
+ <message name="IDS_ACCNAME_APP_UPGRADE_RECOMMENDED" desc="The accessible name for the app menu when software update is available.">
+ <ph name="ACCNAME_APP">$1<ex>Chrome</ex></ph> (Update is available)
+ </message>
<message name="IDS_ACCNAME_BACK" desc="The accessible name for the back button.">
Back
</message>
diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc
index 106a768..74875d1 100644
--- a/chrome/browser/ui/views/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar_view.cc
@@ -194,7 +194,7 @@ void ToolbarView::Init() {
// Add any necessary badges to the menu item based on the system state.
if (IsUpgradeRecommended() || ShouldShowIncompatibilityWarning()) {
- UpdateAppMenuBadge();
+ UpdateAppMenuState();
}
LoadImages();
@@ -424,7 +424,7 @@ void ToolbarView::Observe(int type,
case chrome::NOTIFICATION_UPGRADE_RECOMMENDED:
case chrome::NOTIFICATION_MODULE_INCOMPATIBILITY_BADGE_CHANGE:
case chrome::NOTIFICATION_GLOBAL_ERRORS_CHANGED:
- UpdateAppMenuBadge();
+ UpdateAppMenuState();
break;
#if defined(OS_WIN) && !defined(USE_AURA)
case chrome::NOTIFICATION_CRITICAL_UPGRADE_INSTALLED:
@@ -738,7 +738,14 @@ void ToolbarView::ShowCriticalNotification() {
#endif
}
-void ToolbarView::UpdateAppMenuBadge() {
+void ToolbarView::UpdateAppMenuState() {
+ string16 accname_app = l10n_util::GetStringUTF16(IDS_ACCNAME_APP);
+ if (IsUpgradeRecommended()) {
+ accname_app = l10n_util::GetStringFUTF16(
+ IDS_ACCNAME_APP_UPGRADE_RECOMMENDED, accname_app);
+ }
+ app_menu_->SetAccessibleName(accname_app);
+
app_menu_->SetIcon(GetAppMenuIcon(views::CustomButton::BS_NORMAL));
app_menu_->SetHoverIcon(GetAppMenuIcon(views::CustomButton::BS_HOT));
app_menu_->SetPushedIcon(GetAppMenuIcon(views::CustomButton::BS_PUSHED));
diff --git a/chrome/browser/ui/views/toolbar_view.h b/chrome/browser/ui/views/toolbar_view.h
index 2fe61e4..c5df50a 100644
--- a/chrome/browser/ui/views/toolbar_view.h
+++ b/chrome/browser/ui/views/toolbar_view.h
@@ -171,8 +171,8 @@ class ToolbarView : public AccessiblePaneView,
// Shows the critical notification bubble against the wrench menu.
void ShowCriticalNotification();
- // Updates the badge on the app menu (Wrench).
- void UpdateAppMenuBadge();
+ // Updates the badge and the accessible name of the app menu (Wrench).
+ void UpdateAppMenuState();
// Gets a badge for the wrench icon corresponding to the number of
// unacknowledged background pages in the system.