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

Unified Diff: ui/views/controls/tabbed_pane/tabbed_pane.h

Issue 2578303003: a11y: Add a11y information to views::Tab and manually ignore its a11y children. (Closed)
Patch Set: Rebase Created 3 years, 11 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 | « ui/views/BUILD.gn ('k') | ui/views/controls/tabbed_pane/tabbed_pane.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/tabbed_pane/tabbed_pane.h
diff --git a/ui/views/controls/tabbed_pane/tabbed_pane.h b/ui/views/controls/tabbed_pane/tabbed_pane.h
index 4ff3c6922bd1c88733c943f7e2fa833d70e1e662..aca7f69031ef232daffa6c878a4704f24f9f10e1 100644
--- a/ui/views/controls/tabbed_pane/tabbed_pane.h
+++ b/ui/views/controls/tabbed_pane/tabbed_pane.h
@@ -17,6 +17,11 @@ class Tab;
class TabbedPaneListener;
class TabStrip;
+namespace test {
+class TabbedPaneAccessibilityMacTest;
+class TabbedPaneTest;
+}
+
// TabbedPane is a view that shows tabs. When the user clicks on a tab, the
// associated view is displayed.
class VIEWS_EXPORT TabbedPane : public View {
@@ -61,11 +66,8 @@ class VIEWS_EXPORT TabbedPane : public View {
friend class FocusTraversalTest;
friend class Tab;
friend class TabStrip;
- FRIEND_TEST_ALL_PREFIXES(TabbedPaneTest, AddAndSelect);
- FRIEND_TEST_ALL_PREFIXES(TabbedPaneTest, ArrowKeyBindings);
-
- // Get the Tab (the tabstrip view, not its content) at the valid |index|.
- Tab* GetTabAt(int index);
+ friend class test::TabbedPaneTest;
+ friend class test::TabbedPaneAccessibilityMacTest;
// Get the Tab (the tabstrip view, not its content) at the selected index.
Tab* GetSelectedTab();
@@ -121,6 +123,8 @@ class Tab : public View {
void OnGestureEvent(ui::GestureEvent* event) override;
gfx::Size GetPreferredSize() const override;
const char* GetClassName() const override;
+ void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
+ bool HandleAccessibleAction(const ui::AXActionData& action_data) override;
void OnFocus() override;
void OnBlur() override;
bool OnKeyPressed(const ui::KeyEvent& event) override;
@@ -150,6 +154,33 @@ class Tab : public View {
DISALLOW_COPY_AND_ASSIGN(Tab);
};
+// The tab strip shown above the tab contents.
+class TabStrip : public View {
+ public:
+ // Internal class name.
+ static const char kViewClassName[];
+
+ TabStrip();
+ ~TabStrip() override;
+
+ // Called by TabStrip when the selected tab changes. This function is only
+ // called if |from_tab| is not null, i.e., there was a previously selected
+ // tab.
+ virtual void OnSelectedTabChanged(Tab* from_tab, Tab* to_tab);
+
+ // Overridden from View:
+ const char* GetClassName() const override;
+ void OnPaintBorder(gfx::Canvas* canvas) override;
+
+ Tab* GetSelectedTab() const;
+ Tab* GetTabAtDeltaFromSelected(int delta) const;
+ Tab* GetTabAtIndex(int index) const;
+ int GetSelectedTabIndex() const;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TabStrip);
+};
+
} // namespace views
#endif // UI_VIEWS_CONTROLS_TABBED_PANE_TABBED_PANE_H_
« no previous file with comments | « ui/views/BUILD.gn ('k') | ui/views/controls/tabbed_pane/tabbed_pane.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698