Commit 3fbddcd5 authored by ellyjones's avatar ellyjones Committed by Commit bot

cocoa: give bookmarks menu an accessible title

Without this VoiceOver reads the window title, which is "BmbPopUpWindow".

BUG=641496

Review-Url: https://codereview.chromium.org/2320723006
Cr-Commit-Position: refs/heads/master@{#417573}
parent 887c3eae
......@@ -7434,6 +7434,10 @@ Keep your key file in a safe place. You will need it to create new versions of y
<message name="IDS_ACCNAME_BOOKMARKS_CHEVRON" desc="The accessible name for the chevron visible if not all the bookmark buttons fit.">
Menu containing hidden bookmarks
</message>
<message name="IDS_ACCNAME_BOOKMARKS_MENU" desc="The accessible name for
the Bookmarks menu.">
Bookmarks menu
</message>
<message name="IDS_ACCNAME_SEPARATOR" desc="The accessible name for a separator.">
Separator
</message>
......
......@@ -8,7 +8,9 @@
#import "base/mac/scoped_nsobject.h"
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_constants.h"
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.h"
#include "chrome/grit/generated_resources.h"
#import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSColor+Luminance.h"
#include "ui/base/l10n/l10n_util_mac.h"
#include "ui/base/material_design/material_design_controller.h"
using bookmarks::kBookmarkBarMenuCornerRadius;
......@@ -20,6 +22,12 @@ const CGFloat kMDFolderWindowBackgroundColor = 237. / 255.;
} // namespace
@interface BookmarkBarFolderWindow (Accessibility)
- (NSString*)accessibilityTitle;
@end
@implementation BookmarkBarFolderWindow
- (id)initWithContentRect:(NSRect)contentRect
......@@ -48,6 +56,12 @@ const CGFloat kMDFolderWindowBackgroundColor = 237. / 255.;
- (void)keyDown:(NSEvent *)theEvent {
}
// If the menu doesn't have a separate accessibleTitle, it will get announced as
// its normal window title, which is "BmbPopUpWindow".
- (NSString*)accessibilityTitle {
return l10n_util::GetNSString(IDS_ACCNAME_BOOKMARKS_MENU);
}
@end
......
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