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

Side by Side Diff: chrome/browser/ui/views/subtle_notification_view.h

Issue 2010493005: a11y/Mac: Add screenreader support for SubtleNotificationView announcements. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and use title instead of value. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_VIEWS_SUBTLE_NOTIFICATION_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_SUBTLE_NOTIFICATION_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_SUBTLE_NOTIFICATION_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_SUBTLE_NOTIFICATION_VIEW_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "ui/gfx/native_widget_types.h" 10 #include "ui/gfx/native_widget_types.h"
11 #include "ui/views/view.h" 11 #include "ui/views/view.h"
12 12
13 namespace views { 13 namespace views {
Matt Giuca 2016/06/22 02:59:20 Need a forward-declare of ui::AXViewState.
Patti Lor 2016/06/23 01:00:39 Done, thanks.
Matt Giuca 2016/06/24 04:21:12 It's ui::AXViewState, not views::AXViewState.
Patti Lor 2016/06/27 05:10:38 Done. Thanks again for picking up on that. D:
14 class Link; 14 class Link;
15 class LinkListener; 15 class LinkListener;
16 class Widget; 16 class Widget;
17 } 17 }
18 18
19 // A transient, transparent notification bubble that appears at the top of the 19 // A transient, transparent notification bubble that appears at the top of the
20 // browser window to give the user a short instruction (e.g., "Press Esc to exit 20 // browser window to give the user a short instruction (e.g., "Press Esc to exit
21 // full screen"). Unlike a full notification, a subtle notification 21 // full screen"). Unlike a full notification, a subtle notification
22 // auto-dismisses after a short period of time. It also has special 22 // auto-dismisses after a short period of time. It also has special
23 // functionality for displaying keyboard shortcuts (rendering the keys inside a 23 // functionality for displaying keyboard shortcuts (rendering the keys inside a
24 // rounded rectangle). 24 // rounded rectangle).
25 class SubtleNotificationView : public views::View { 25 class SubtleNotificationView : public views::View {
26 public: 26 public:
27 explicit SubtleNotificationView(views::LinkListener* link_listener); 27 explicit SubtleNotificationView(views::LinkListener* link_listener);
28 ~SubtleNotificationView() override; 28 ~SubtleNotificationView() override;
29 29
30 void UpdateContent(const base::string16& instruction_text, 30 void UpdateContent(const base::string16& instruction_text,
31 const base::string16& link_text); 31 const base::string16& link_text);
32 32
33 // Creates a Widget containing a SubtleNotificationView. If |accept_events|, 33 // Creates a Widget containing a SubtleNotificationView. If |accept_events|,
34 // the bubble will intercept mouse events (required if there is a clickable 34 // the bubble will intercept mouse events (required if there is a clickable
35 // link); if not, events will go through to the underlying window. 35 // link); if not, events will go through to the underlying window.
36 static views::Widget* CreatePopupWidget(gfx::NativeView parent_view, 36 static views::Widget* CreatePopupWidget(gfx::NativeView parent_view,
37 SubtleNotificationView* view, 37 SubtleNotificationView* view,
38 bool accept_events); 38 bool accept_events);
39 39
40 // views::View:
41 void GetAccessibleState(ui::AXViewState* state) override;
42
40 private: 43 private:
41 class InstructionView; 44 class InstructionView;
42 45
43 // Text displayed in the bubble, with optional keyboard keys. 46 // Text displayed in the bubble, with optional keyboard keys.
44 InstructionView* instruction_view_; 47 InstructionView* instruction_view_;
45 // Clickable text link. If there is also an instruction view, this appears 48 // Clickable text link. If there is also an instruction view, this appears
46 // after the instruction text. 49 // after the instruction text.
47 views::Link* link_; 50 views::Link* link_;
48 51
49 DISALLOW_COPY_AND_ASSIGN(SubtleNotificationView); 52 DISALLOW_COPY_AND_ASSIGN(SubtleNotificationView);
50 }; 53 };
51 54
52 #endif // CHROME_BROWSER_UI_VIEWS_SUBTLE_NOTIFICATION_VIEW_H_ 55 #endif // CHROME_BROWSER_UI_VIEWS_SUBTLE_NOTIFICATION_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698