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/base/accessibility/accessible_view_state.h" | 9 #include "ui/base/accessibility/accessible_view_state.h" |
10 #include "ui/gfx/canvas.h" | 10 #include "ui/gfx/canvas.h" |
11 #include "ui/views/border.h" | 11 #include "ui/views/border.h" |
12 #include "ui/views/bubble/bubble_border.h" | 12 #include "ui/views/bubble/bubble_border.h" |
13 #include "ui/views/controls/menu/menu_config.h" | 13 #include "ui/views/controls/menu/menu_config.h" |
14 #include "ui/views/controls/menu/menu_controller.h" | 14 #include "ui/views/controls/menu/menu_controller.h" |
15 #include "ui/views/controls/menu/menu_item_view.h" | 15 #include "ui/views/controls/menu/menu_item_view.h" |
16 #include "ui/views/controls/menu/submenu_view.h" | 16 #include "ui/views/controls/menu/submenu_view.h" |
17 #include "ui/views/round_rect_painter.h" | 17 #include "ui/views/round_rect_painter.h" |
18 | 18 |
19 #if defined(USE_AURA) | 19 #if defined(USE_AURA) |
20 #include "ui/native_theme/native_theme_aura.h" | 20 #include "ui/native_theme/native_theme_aura.h" |
21 #endif | 21 #endif |
22 | 22 |
23 using ui::NativeTheme; | 23 using ui::NativeTheme; |
24 | 24 |
25 // Height of the scroll arrow. | |
26 // This goes up to 4 with large fonts, but this is close enough for now. | |
27 static const int scroll_arrow_height = 3; | |
28 | |
29 namespace views { | 25 namespace views { |
30 | 26 |
31 namespace { | 27 namespace { |
32 | 28 |
33 static const int kBorderPaddingDueToRoundedCorners = 1; | 29 static const int kBorderPaddingDueToRoundedCorners = 1; |
34 | 30 |
35 // MenuScrollButton ------------------------------------------------------------ | 31 // MenuScrollButton ------------------------------------------------------------ |
36 | 32 |
37 // MenuScrollButton is used for the scroll buttons when not all menu items fit | 33 // MenuScrollButton is used for the scroll buttons when not all menu items fit |
38 // on screen. MenuScrollButton forwards appropriate events to the | 34 // on screen. MenuScrollButton forwards appropriate events to the |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 case views::MenuItemView::BUBBLE_ABOVE: | 328 case views::MenuItemView::BUBBLE_ABOVE: |
333 return BubbleBorder::BOTTOM_CENTER; | 329 return BubbleBorder::BOTTOM_CENTER; |
334 case views::MenuItemView::BUBBLE_BELOW: | 330 case views::MenuItemView::BUBBLE_BELOW: |
335 return BubbleBorder::TOP_CENTER; | 331 return BubbleBorder::TOP_CENTER; |
336 default: | 332 default: |
337 return BubbleBorder::NONE; | 333 return BubbleBorder::NONE; |
338 } | 334 } |
339 } | 335 } |
340 | 336 |
341 } // namespace views | 337 } // namespace views |
OLD | NEW |