Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(879)

Unified Diff: chrome/browser/ui/cocoa/location_bar/location_bar_decoration.mm

Issue 2841963002: cocoa: fix a11y labeling & state on search icon (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/location_bar/location_bar_decoration.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_decoration.mm b/chrome/browser/ui/cocoa/location_bar/location_bar_decoration.mm
index d9c784882e4c572ef57e3de8187a0c1566efa75d..7182d5e41d7ccd409ff4e17e147ede8fbe025601 100644
--- a/chrome/browser/ui/cocoa/location_bar/location_bar_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/location_bar_decoration.mm
@@ -88,7 +88,8 @@ - (void)actionDidHappen {
}
- (NSString*)accessibilityLabel {
- return owner_->GetToolTip();
+ NSString* label = owner_->GetAccessibilityLabel();
+ return label ? label : owner_->GetToolTip();
}
@end
@@ -162,6 +163,10 @@ - (void)mouseExited:(NSEvent*)event {
return NSInsetRect(frame, 0.0, kBackgroundFrameYInset);
}
+void LocationBarDecoration::UpdateAccessibilityView() {
+ [accessibility_view_.get() setEnabled:AcceptsMousePress()];
+}
+
void LocationBarDecoration::DrawInFrame(NSRect frame, NSView* control_view) {
NOTREACHED();
}
@@ -197,6 +202,10 @@ - (void)mouseExited:(NSEvent*)event {
return nil;
}
+NSString* LocationBarDecoration::GetAccessibilityLabel() {
+ return nil;
+}
+
CrTrackingArea* LocationBarDecoration::SetupTrackingArea(NSRect frame,
NSView* control_view) {
if (!AcceptsMousePress() || !control_view)

Powered by Google App Engine
This is Rietveld 408576698