| OLD | NEW |
| 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 #include "ui/views/controls/tabbed_pane/tabbed_pane.h" | 5 #include "ui/views/controls/tabbed_pane/tabbed_pane.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "cc/paint/paint_flags.h" | 9 #include "cc/paint/paint_flags.h" |
| 10 #include "third_party/skia/include/core/SkPath.h" | 10 #include "third_party/skia/include/core/SkPath.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 const gfx::Font::Weight kHoverWeight = gfx::Font::Weight::NORMAL; | 42 const gfx::Font::Weight kHoverWeight = gfx::Font::Weight::NORMAL; |
| 43 const gfx::Font::Weight kActiveWeight = gfx::Font::Weight::BOLD; | 43 const gfx::Font::Weight kActiveWeight = gfx::Font::Weight::BOLD; |
| 44 const gfx::Font::Weight kInactiveWeight = gfx::Font::Weight::NORMAL; | 44 const gfx::Font::Weight kInactiveWeight = gfx::Font::Weight::NORMAL; |
| 45 | 45 |
| 46 const int kHarmonyTabStripTabHeight = 40; | 46 const int kHarmonyTabStripTabHeight = 40; |
| 47 | 47 |
| 48 // The View containing the text for each tab in the tab strip. | 48 // The View containing the text for each tab in the tab strip. |
| 49 class TabLabel : public Label { | 49 class TabLabel : public Label { |
| 50 public: | 50 public: |
| 51 explicit TabLabel(const base::string16& tab_title) | 51 explicit TabLabel(const base::string16& tab_title) |
| 52 : Label(tab_title, | 52 : Label(tab_title, style::CONTEXT_LABEL, style::STYLE_TAB_ACTIVE) {} |
| 53 ui::ResourceBundle::GetSharedInstance().GetFontListWithDelta( | |
| 54 ui::kLabelFontSizeDelta, | |
| 55 gfx::Font::NORMAL, | |
| 56 kActiveWeight)) {} | |
| 57 | 53 |
| 58 // Label: | 54 // Label: |
| 59 void GetAccessibleNodeData(ui::AXNodeData* data) override { | 55 void GetAccessibleNodeData(ui::AXNodeData* data) override { |
| 60 // views::Tab shouldn't expose any of its children in the a11y tree. | 56 // views::Tab shouldn't expose any of its children in the a11y tree. |
| 61 // Instead, it should provide the a11y information itself. Normally, | 57 // Instead, it should provide the a11y information itself. Normally, |
| 62 // non-keyboard-focusable children of keyboard-focusable parents are | 58 // non-keyboard-focusable children of keyboard-focusable parents are |
| 63 // ignored, but Tabs only mark the currently selected tab as | 59 // ignored, but Tabs only mark the currently selected tab as |
| 64 // keyboard-focusable. This means all unselected Tabs expose their children | 60 // keyboard-focusable. This means all unselected Tabs expose their children |
| 65 // to the a11y tree. To fix, manually ignore the children. | 61 // to the a11y tree. To fix, manually ignore the children. |
| 66 data->role = ui::AX_ROLE_IGNORED; | 62 data->role = ui::AX_ROLE_IGNORED; |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 | 624 |
| 629 View* TabbedPane::GetSelectedTabContentView() { | 625 View* TabbedPane::GetSelectedTabContentView() { |
| 630 return GetSelectedTab() ? GetSelectedTab()->contents() : nullptr; | 626 return GetSelectedTab() ? GetSelectedTab()->contents() : nullptr; |
| 631 } | 627 } |
| 632 | 628 |
| 633 void TabbedPane::GetAccessibleNodeData(ui::AXNodeData* node_data) { | 629 void TabbedPane::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| 634 node_data->role = ui::AX_ROLE_TAB_LIST; | 630 node_data->role = ui::AX_ROLE_TAB_LIST; |
| 635 } | 631 } |
| 636 | 632 |
| 637 } // namespace views | 633 } // namespace views |
| OLD | NEW |