diff options
author | dtseng@chromium.org <dtseng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-27 00:20:37 +0000 |
---|---|---|
committer | dtseng@chromium.org <dtseng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-27 00:20:37 +0000 |
commit | d4bc214d557c7719a6c41365813f3ef5c8294924 (patch) | |
tree | 1ca46943a170d2fe9ed94a94f179f3f0b076fd18 /chrome/browser/cocoa | |
parent | 7339cd25809e6fd5ec8a18a373daee7182034ba3 (diff) | |
download | chromium_src-d4bc214d557c7719a6c41365813f3ef5c8294924.zip chromium_src-d4bc214d557c7719a6c41365813f3ef5c8294924.tar.gz chromium_src-d4bc214d557c7719a6c41365813f3ef5c8294924.tar.bz2 |
Ignore the close button when accessibility is on. This seems to be the only way for VoiceOver and AccessibilityInspector to ignore the close button which is seen as a child of the tab button.
BUG=37336
TEST=BrowserAccessibilityTest.* and manually test VoiceOver on/off with new tabs. Verify that tabs are read correctly.
Review URL: http://codereview.chromium.org/3926002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63988 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r-- | chrome/browser/cocoa/tab_view.h | 4 | ||||
-rw-r--r-- | chrome/browser/cocoa/tab_view.mm | 11 |
2 files changed, 15 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/tab_view.h b/chrome/browser/cocoa/tab_view.h index 74689c7..73c6334 100644 --- a/chrome/browser/cocoa/tab_view.h +++ b/chrome/browser/cocoa/tab_view.h @@ -47,6 +47,10 @@ enum AlertState { // TODO(rohitrao): Add this button to a CoreAnimation layer so we can fade it // in and out on mouseovers. IBOutlet HoverCloseButton* closeButton_; + + // See awakeFromNib for purpose. + scoped_nsobject<HoverCloseButton> closeButtonRetainer_; + BOOL closing_; // Tracking area for close button mouseover images. diff --git a/chrome/browser/cocoa/tab_view.mm b/chrome/browser/cocoa/tab_view.mm index 7b7ed59..1550d7e 100644 --- a/chrome/browser/cocoa/tab_view.mm +++ b/chrome/browser/cocoa/tab_view.mm @@ -8,6 +8,7 @@ #import "base/mac_util.h" #include "base/mac/scoped_cftyperef.h" #include "base/nsimage_cache_mac.h" +#include "chrome/browser/accessibility/browser_accessibility_state.h" #import "chrome/browser/cocoa/tab_controller.h" #import "chrome/browser/cocoa/tab_window_controller.h" #import "chrome/browser/cocoa/themed_window.h" @@ -73,6 +74,16 @@ const CGFloat kRapidCloseDist = 2.5; - (void)awakeFromNib { [self setShowsDivider:NO]; + + // It is desirable for us to remove the close button from the cocoa hierarchy, + // so that VoiceOver does not encounter it. + // TODO(dtseng): crbug.com/59978. + // Retain in case we remove it from its superview. + closeButtonRetainer_.reset([closeButton_ retain]); + if (Singleton<BrowserAccessibilityState>::get()->IsAccessibleBrowser()) { + // The superview gives up ownership of the closeButton here. + [closeButton_ removeFromSuperview]; + } } - (void)dealloc { |