diff options
Diffstat (limited to 'views/controls/tabbed_pane/tabbed_pane.cc')
-rw-r--r-- | views/controls/tabbed_pane/tabbed_pane.cc | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/views/controls/tabbed_pane/tabbed_pane.cc b/views/controls/tabbed_pane/tabbed_pane.cc index 1091407..eb9f971 100644 --- a/views/controls/tabbed_pane/tabbed_pane.cc +++ b/views/controls/tabbed_pane/tabbed_pane.cc @@ -5,13 +5,11 @@ #include "views/controls/tabbed_pane/tabbed_pane.h" #include "base/logging.h" -#include "ui/base/accessibility/accessible_view_state.h" // TODO(avi): remove when not needed #include "base/utf_string_conversions.h" #include "ui/base/keycodes/keyboard_codes.h" #include "views/controls/native/native_view_host.h" #include "views/controls/tabbed_pane/native_tabbed_pane_wrapper.h" -#include "views/widget/widget.h" namespace views { @@ -40,6 +38,7 @@ void TabbedPane::AddTabAtIndex(int index, bool select_if_first_tab) { native_tabbed_pane_->AddTabAtIndex(index, title, contents, select_if_first_tab); + contents->SetAccessibleName(WideToUTF16Hack(title)); PreferredSizeChanged(); } @@ -61,10 +60,6 @@ void TabbedPane::SelectTabAt(int index) { native_tabbed_pane_->SelectTabAt(index); } -void TabbedPane::SetAccessibleName(const string16& name) { - accessible_name_ = name; -} - int TabbedPane::GetTabCount() { return native_tabbed_pane_->GetTabCount(); } @@ -123,10 +118,8 @@ void TabbedPane::OnFocus() { native_tabbed_pane_->SetFocus(); View* selected_tab = GetSelectedTab(); - if (selected_tab) { - selected_tab->GetWidget()->NotifyAccessibilityEvent( - selected_tab, ui::AccessibilityTypes::EVENT_FOCUS, true); - } + if (selected_tab) + selected_tab->NotifyAccessibilityEvent(AccessibilityTypes::EVENT_FOCUS); } else View::OnFocus(); // Will focus the RootView window (so we still get @@ -138,9 +131,8 @@ void TabbedPane::OnPaintFocusBorder(gfx::Canvas* canvas) { View::OnPaintFocusBorder(canvas); } -void TabbedPane::GetAccessibleState(ui::AccessibleViewState* state) { - state->role = ui::AccessibilityTypes::ROLE_PAGETABLIST; - state->name = accessible_name_; +AccessibilityTypes::Role TabbedPane::GetAccessibleRole() { + return AccessibilityTypes::ROLE_PAGETABLIST; } gfx::Size TabbedPane::GetPreferredSize() { |