| 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/submenu_view.h" | 5 #include "ui/views/controls/menu/submenu_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "ui/accessibility/ax_node_data.h" | 10 #include "ui/accessibility/ax_node_data.h" |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 return gfx::Size(width, height + insets.height()); | 181 return gfx::Size(width, height + insets.height()); |
| 182 } | 182 } |
| 183 | 183 |
| 184 void SubmenuView::GetAccessibleNodeData(ui::AXNodeData* node_data) { | 184 void SubmenuView::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| 185 // Inherit most of the state from the parent menu item, except the role and | 185 // Inherit most of the state from the parent menu item, except the role and |
| 186 // the orientation. | 186 // the orientation. |
| 187 if (GetMenuItem()) | 187 if (GetMenuItem()) |
| 188 GetMenuItem()->GetAccessibleNodeData(node_data); | 188 GetMenuItem()->GetAccessibleNodeData(node_data); |
| 189 node_data->role = ui::AX_ROLE_MENU_LIST_POPUP; | 189 node_data->role = ui::AX_ROLE_MENU_LIST_POPUP; |
| 190 // Menus in Chrome are always traversed in a vertical direction. | 190 // Menus in Chrome are always traversed in a vertical direction. |
| 191 node_data->AddStateFlag(ui::AX_STATE_VERTICAL); | 191 node_data->AddState(ui::AX_STATE_VERTICAL); |
| 192 } | 192 } |
| 193 | 193 |
| 194 void SubmenuView::PaintChildren(const ui::PaintContext& context) { | 194 void SubmenuView::PaintChildren(const ui::PaintContext& context) { |
| 195 View::PaintChildren(context); | 195 View::PaintChildren(context); |
| 196 | 196 |
| 197 bool paint_drop_indicator = false; | 197 bool paint_drop_indicator = false; |
| 198 if (drop_item_) { | 198 if (drop_item_) { |
| 199 switch (drop_position_) { | 199 switch (drop_position_) { |
| 200 case MenuDelegate::DROP_NONE: | 200 case MenuDelegate::DROP_NONE: |
| 201 case MenuDelegate::DROP_ON: | 201 case MenuDelegate::DROP_ON: |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 y = std::max(y, 0); | 514 y = std::max(y, 0); |
| 515 gfx::Rect new_vis_bounds(x, y, vis_bounds.width(), vis_bounds.height()); | 515 gfx::Rect new_vis_bounds(x, y, vis_bounds.width(), vis_bounds.height()); |
| 516 if (new_vis_bounds != vis_bounds) { | 516 if (new_vis_bounds != vis_bounds) { |
| 517 ScrollRectToVisible(new_vis_bounds); | 517 ScrollRectToVisible(new_vis_bounds); |
| 518 return true; | 518 return true; |
| 519 } | 519 } |
| 520 return false; | 520 return false; |
| 521 } | 521 } |
| 522 | 522 |
| 523 } // namespace views | 523 } // namespace views |
| OLD | NEW |