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

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

Issue 2091063002: Location bar: make decorations accessible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: first round Created 4 years, 6 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 a35e2d3e30d3494f4b37c24dee5e88a91bbf7805..8ce2c46545ee9b7c77c140e860e650da942d32b0 100644
--- a/chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h
+++ b/chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h
@@ -7,6 +7,7 @@
#import <Cocoa/Cocoa.h>
+#include "base/mac/scoped_nsobject.h"
#include "base/macros.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/vector_icons_public.h"
@@ -23,10 +24,8 @@
class LocationBarDecoration {
public:
- LocationBarDecoration()
- : visible_(false) {
- }
- virtual ~LocationBarDecoration() {}
+ LocationBarDecoration();
+ virtual ~LocationBarDecoration();
// Determines whether the decoration is visible.
virtual bool IsVisible() const;
@@ -85,6 +84,11 @@ class LocationBarDecoration {
// Gets the font used to draw text in the decoration.
virtual NSFont* GetFont() const;
+ // Gets the accessibility NSView for this decoration. This NSView is
+ // a transparent button that is positioned over this decoration to allow it to
+ // accept keyboard focus and keyboard activations.
+ virtual NSView* GetAccessibilityView();
+
// Helper to get where the bubble point should land. |frame| specifies the
// decorations' image rectangle. Defaults to |frame.origin| if not overriden.
// The return value is in the same coordinate system as |frame|.
@@ -101,6 +105,11 @@ class LocationBarDecoration {
static NSSize GetLabelSize(NSString* label,
NSDictionary* attributes);
+ // Called when the accessibility view receives an action via a keyboard button
+ // press or VoiceOver activation. This method is public so it can be exposed
+ // to the private DecorationAccessibilityView helper class.
+ void OnAccessibilityViewAction();
+
// Width returned by |GetWidthForSpace()| when the item should be
// omitted for this width;
static const CGFloat kOmittedWidth;
@@ -123,7 +132,8 @@ class LocationBarDecoration {
NSColor* GetDividerColor(bool location_bar_is_dark) const;
private:
- bool visible_;
+ bool visible_ = false;
+ base::scoped_nsobject<NSView> accessibility_view_;
DISALLOW_COPY_AND_ASSIGN(LocationBarDecoration);
};
« 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