| 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/menu/menu_scroll_view_container.h" | 5 #include "ui/views/controls/menu/menu_scroll_view_container.h" |
| 6 | 6 |
| 7 #include "third_party/skia/include/core/SkPaint.h" | 7 #include "third_party/skia/include/core/SkPaint.h" |
| 8 #include "third_party/skia/include/core/SkPath.h" | 8 #include "third_party/skia/include/core/SkPath.h" |
| 9 #include "ui/accessibility/ax_view_state.h" | 9 #include "ui/accessibility/ax_view_state.h" |
| 10 #include "ui/gfx/canvas.h" | 10 #include "ui/gfx/canvas.h" |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 | 255 |
| 256 void MenuScrollViewContainer::GetAccessibleState( | 256 void MenuScrollViewContainer::GetAccessibleState( |
| 257 ui::AXViewState* state) { | 257 ui::AXViewState* state) { |
| 258 // Get the name from the submenu view. | 258 // Get the name from the submenu view. |
| 259 content_view_->GetAccessibleState(state); | 259 content_view_->GetAccessibleState(state); |
| 260 | 260 |
| 261 // Now change the role. | 261 // Now change the role. |
| 262 state->role = ui::AX_ROLE_MENU_BAR; | 262 state->role = ui::AX_ROLE_MENU_BAR; |
| 263 // Some AT (like NVDA) will not process focus events on menu item children | 263 // Some AT (like NVDA) will not process focus events on menu item children |
| 264 // unless a parent claims to be focused. | 264 // unless a parent claims to be focused. |
| 265 state->state = ui::AX_STATE_FOCUSED; | 265 state->SetStateFlag(ui::AX_STATE_FOCUSED); |
| 266 } | 266 } |
| 267 | 267 |
| 268 void MenuScrollViewContainer::OnBoundsChanged( | 268 void MenuScrollViewContainer::OnBoundsChanged( |
| 269 const gfx::Rect& previous_bounds) { | 269 const gfx::Rect& previous_bounds) { |
| 270 gfx::Size content_pref = scroll_view_->GetContents()->GetPreferredSize(); | 270 gfx::Size content_pref = scroll_view_->GetContents()->GetPreferredSize(); |
| 271 scroll_up_button_->SetVisible(content_pref.height() > height()); | 271 scroll_up_button_->SetVisible(content_pref.height() > height()); |
| 272 scroll_down_button_->SetVisible(content_pref.height() > height()); | 272 scroll_down_button_->SetVisible(content_pref.height() > height()); |
| 273 Layout(); | 273 Layout(); |
| 274 } | 274 } |
| 275 | 275 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 case views::MenuItemView::BUBBLE_ABOVE: | 329 case views::MenuItemView::BUBBLE_ABOVE: |
| 330 return BubbleBorder::BOTTOM_CENTER; | 330 return BubbleBorder::BOTTOM_CENTER; |
| 331 case views::MenuItemView::BUBBLE_BELOW: | 331 case views::MenuItemView::BUBBLE_BELOW: |
| 332 return BubbleBorder::TOP_CENTER; | 332 return BubbleBorder::TOP_CENTER; |
| 333 default: | 333 default: |
| 334 return BubbleBorder::NONE; | 334 return BubbleBorder::NONE; |
| 335 } | 335 } |
| 336 } | 336 } |
| 337 | 337 |
| 338 } // namespace views | 338 } // namespace views |
| OLD | NEW |