Skip to content

Commit

Permalink
views: [accessibility] Add accessible name for the Close button in ge…
Browse files Browse the repository at this point in the history
…neric Window.

BUG=9614
TEST=open AccExplorer, open a dialog window, point it to the Close button in the top-right corner, see if it shows Close as the accessible name.

Patch from Thiago Farina <thiago.farina@gmail.com>
Review URL: http://codereview.chromium.org/1155005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42270 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
ctguil@chromium.org committed Mar 22, 2010
1 parent 02aae3f commit 8c157cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/resources/app_strings.grd
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ need to be translated for each locale.-->
<message name="IDS_APP_ACCACTION_PRESS" desc="The accessible default action for a button.">
Press
</message>
<message name="IDS_APP_ACCNAME_CLOSE" desc="The accessible name for the Close button.">
Close
</message>

<!-- Scroll Bar Context Menu Labels -->
<message name="IDS_APP_SCROLLBAR_CXMENU_SCROLLHERE" desc="The label for the 'Scroll Here' item">
Expand Down
6 changes: 5 additions & 1 deletion views/window/custom_frame_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "app/gfx/canvas.h"
#include "app/gfx/font.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "app/theme_provider.h"
#if defined(OS_WIN)
Expand All @@ -14,6 +15,7 @@
#endif
#include "gfx/path.h"
#include "grit/app_resources.h"
#include "grit/app_strings.h"
#include "views/window/client_view.h"
#if defined(OS_LINUX)
#include "views/window/hit_test.h"
Expand Down Expand Up @@ -72,6 +74,8 @@ CustomFrameView::CustomFrameView(Window* frame)

ResourceBundle& rb = ResourceBundle::GetSharedInstance();

close_button_->SetAccessibleName(l10n_util::GetString(IDS_APP_ACCNAME_CLOSE));

// Close button images will be set in LayoutWindowControls().
AddChildView(close_button_);

Expand Down Expand Up @@ -569,7 +573,7 @@ void CustomFrameView::InitClass() {
#if defined(OS_WIN)
title_font_ = new gfx::Font(win_util::GetWindowTitleFont());
#elif defined(OS_LINUX)
// TODO: need to resolve what font this is.
// TODO(ben): need to resolve what font this is.
title_font_ = new gfx::Font();
#endif
initialized = true;
Expand Down

0 comments on commit 8c157cf

Please sign in to comment.