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

Side by Side 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: Add tests. 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 UI_VIEWS_CONTROLS_TABBED_PANE_TABBED_PANE_H_ 5 #ifndef UI_VIEWS_CONTROLS_TABBED_PANE_TABBED_PANE_H_
6 #define UI_VIEWS_CONTROLS_TABBED_PANE_TABBED_PANE_H_ 6 #define UI_VIEWS_CONTROLS_TABBED_PANE_TABBED_PANE_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 // Selects |tab| (the tabstrip view, not its content) if it is valid. 53 // Selects |tab| (the tabstrip view, not its content) if it is valid.
54 void SelectTab(Tab* tab); 54 void SelectTab(Tab* tab);
55 55
56 // Overridden from View: 56 // Overridden from View:
57 gfx::Size GetPreferredSize() const override; 57 gfx::Size GetPreferredSize() const override;
58 const char* GetClassName() const override; 58 const char* GetClassName() const override;
59 59
60 private: 60 private:
61 friend class FocusTraversalTest; 61 friend class FocusTraversalTest;
62 friend class Tab; 62 friend class Tab;
63 friend class TabbedPaneMacAccessibilityTest;
tapted 2017/01/06 04:25:11 this should have a views::test:: namespace on it.
Patti Lor 2017/01/09 22:39:27 Done.
63 friend class TabStrip; 64 friend class TabStrip;
64 FRIEND_TEST_ALL_PREFIXES(TabbedPaneTest, AddAndSelect); 65 FRIEND_TEST_ALL_PREFIXES(TabbedPaneTest, AddAndSelect);
65 FRIEND_TEST_ALL_PREFIXES(TabbedPaneTest, ArrowKeyBindings); 66 FRIEND_TEST_ALL_PREFIXES(TabbedPaneTest, ArrowKeyBindings);
66 67 FRIEND_TEST_ALL_PREFIXES(TabbedPaneTest, SelectTabWithAccessibleAction);
67 // Get the Tab (the tabstrip view, not its content) at the valid |index|.
68 Tab* GetTabAt(int index);
tapted 2017/01/06 04:25:11 huh. I guess this got removed at some point and th
Patti Lor 2017/01/09 22:39:27 To do this, I also had to move the class declarati
69 68
70 // Get the Tab (the tabstrip view, not its content) at the selected index. 69 // Get the Tab (the tabstrip view, not its content) at the selected index.
71 Tab* GetSelectedTab(); 70 Tab* GetSelectedTab();
72 71
73 // Returns the content View of the currently selected Tab. 72 // Returns the content View of the currently selected Tab.
74 View* GetSelectedTabContentView(); 73 View* GetSelectedTabContentView();
75 74
76 // Moves the selection by |delta| tabs, where negative delta means leftwards 75 // Moves the selection by |delta| tabs, where negative delta means leftwards
77 // and positive delta means rightwards. Returns whether the selection could be 76 // and positive delta means rightwards. Returns whether the selection could be
78 // moved by that amount; the only way this can fail is if there is only one 77 // moved by that amount; the only way this can fail is if there is only one
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 bool selected() const { return contents_->visible(); } 113 bool selected() const { return contents_->visible(); }
115 void SetSelected(bool selected); 114 void SetSelected(bool selected);
116 115
117 // Overridden from View: 116 // Overridden from View:
118 bool OnMousePressed(const ui::MouseEvent& event) override; 117 bool OnMousePressed(const ui::MouseEvent& event) override;
119 void OnMouseEntered(const ui::MouseEvent& event) override; 118 void OnMouseEntered(const ui::MouseEvent& event) override;
120 void OnMouseExited(const ui::MouseEvent& event) override; 119 void OnMouseExited(const ui::MouseEvent& event) override;
121 void OnGestureEvent(ui::GestureEvent* event) override; 120 void OnGestureEvent(ui::GestureEvent* event) override;
122 gfx::Size GetPreferredSize() const override; 121 gfx::Size GetPreferredSize() const override;
123 const char* GetClassName() const override; 122 const char* GetClassName() const override;
123 void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
124 bool HandleAccessibleAction(const ui::AXActionData& action_data) override;
124 void OnFocus() override; 125 void OnFocus() override;
125 void OnBlur() override; 126 void OnBlur() override;
126 bool OnKeyPressed(const ui::KeyEvent& event) override; 127 bool OnKeyPressed(const ui::KeyEvent& event) override;
127 128
128 protected: 129 protected:
129 Label* title() { return title_; } 130 Label* title() { return title_; }
130 131
131 // Called whenever |tab_state_| changes. 132 // Called whenever |tab_state_| changes.
132 virtual void OnStateChanged(); 133 virtual void OnStateChanged();
133 134
(...skipping 12 matching lines...) Expand all
146 TabState tab_state_; 147 TabState tab_state_;
147 // The content view associated with this tab. 148 // The content view associated with this tab.
148 View* contents_; 149 View* contents_;
149 150
150 DISALLOW_COPY_AND_ASSIGN(Tab); 151 DISALLOW_COPY_AND_ASSIGN(Tab);
151 }; 152 };
152 153
153 } // namespace views 154 } // namespace views
154 155
155 #endif // UI_VIEWS_CONTROLS_TABBED_PANE_TABBED_PANE_H_ 156 #endif // UI_VIEWS_CONTROLS_TABBED_PANE_TABBED_PANE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698