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

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

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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/location_bar/location_bar_decoration.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h
diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h b/chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h
index 93e1ab5f8afad69330483e3b5113a36d6f14fd87..f79f8dc09ac1f9461d650afc2fc8b377156025cc 100644
--- a/chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h
+++ b/chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h
@@ -63,6 +63,10 @@ class LocationBarDecoration {
// Returns the tooltip for this decoration, return |nil| for no tooltip.
virtual NSString* GetToolTip();
+ // Returns the accessibility label for this decoration, return |nil| to use
+ // the result of |GetTooltip()| as a fallback.
+ virtual NSString* GetAccessibilityLabel();
+
// Methods to set up and remove the tracking area from the |control_view|.
CrTrackingArea* SetupTrackingArea(NSRect frame, NSView* control_view);
void RemoveTrackingArea();
@@ -143,6 +147,10 @@ class LocationBarDecoration {
// to the private DecorationAccessibilityView helper class.
void OnAccessibilityViewAction();
+ // Called when the omnibox decoration changes state to update the
+ // accessibility view's attributes to match.
+ void UpdateAccessibilityView();
+
DecorationMouseState state() const { return state_; }
bool active() const { return active_; }
@@ -177,7 +185,7 @@ class LocationBarDecoration {
// True if the decoration is active.
bool active_ = false;
- base::scoped_nsobject<NSView> accessibility_view_;
+ base::scoped_nsobject<NSControl> accessibility_view_;
// The decoration's tracking area. Only set if the decoration accepts a mouse
// press.
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/location_bar/location_bar_decoration.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698