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 "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "third_party/skia/include/core/SkPaint.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" |
11 #include "ui/accessibility/ax_node_data.h" | 11 #include "ui/accessibility/ax_node_data.h" |
12 #include "ui/gfx/canvas.h" | 12 #include "ui/gfx/canvas.h" |
13 #include "ui/gfx/color_palette.h" | 13 #include "ui/gfx/color_palette.h" |
14 #include "ui/views/border.h" | 14 #include "ui/views/border.h" |
15 #include "ui/views/bubble/bubble_border.h" | 15 #include "ui/views/bubble/bubble_border.h" |
16 #include "ui/views/controls/menu/menu_config.h" | 16 #include "ui/views/controls/menu/menu_config.h" |
17 #include "ui/views/controls/menu/menu_controller.h" | 17 #include "ui/views/controls/menu/menu_controller.h" |
18 #include "ui/views/controls/menu/menu_item_view.h" | 18 #include "ui/views/controls/menu/menu_item_view.h" |
19 #include "ui/views/controls/menu/submenu_view.h" | 19 #include "ui/views/controls/menu/submenu_view.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 y = y_bottom + config.scroll_arrow_height; | 94 y = y_bottom + config.scroll_arrow_height; |
95 } else { | 95 } else { |
96 y_bottom = y + config.scroll_arrow_height; | 96 y_bottom = y + config.scroll_arrow_height; |
97 } | 97 } |
98 SkPath path; | 98 SkPath path; |
99 path.setFillType(SkPath::kWinding_FillType); | 99 path.setFillType(SkPath::kWinding_FillType); |
100 path.moveTo(SkIntToScalar(x), SkIntToScalar(y)); | 100 path.moveTo(SkIntToScalar(x), SkIntToScalar(y)); |
101 path.lineTo(SkIntToScalar(x_left), SkIntToScalar(y_bottom)); | 101 path.lineTo(SkIntToScalar(x_left), SkIntToScalar(y_bottom)); |
102 path.lineTo(SkIntToScalar(x_right), SkIntToScalar(y_bottom)); | 102 path.lineTo(SkIntToScalar(x_right), SkIntToScalar(y_bottom)); |
103 path.lineTo(SkIntToScalar(x), SkIntToScalar(y)); | 103 path.lineTo(SkIntToScalar(x), SkIntToScalar(y)); |
104 SkPaint paint; | 104 cc::PaintFlags paint; |
105 paint.setStyle(SkPaint::kFill_Style); | 105 paint.setStyle(cc::PaintFlags::kFill_Style); |
106 paint.setAntiAlias(true); | 106 paint.setAntiAlias(true); |
107 paint.setColor(config.arrow_color); | 107 paint.setColor(config.arrow_color); |
108 canvas->DrawPath(path, paint); | 108 canvas->DrawPath(path, paint); |
109 } | 109 } |
110 | 110 |
111 private: | 111 private: |
112 // SubmenuView we were created for. | 112 // SubmenuView we were created for. |
113 SubmenuView* host_; | 113 SubmenuView* host_; |
114 | 114 |
115 // Direction of the button. | 115 // Direction of the button. |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 case MENU_ANCHOR_BUBBLE_ABOVE: | 317 case MENU_ANCHOR_BUBBLE_ABOVE: |
318 return BubbleBorder::BOTTOM_CENTER; | 318 return BubbleBorder::BOTTOM_CENTER; |
319 case MENU_ANCHOR_BUBBLE_BELOW: | 319 case MENU_ANCHOR_BUBBLE_BELOW: |
320 return BubbleBorder::TOP_CENTER; | 320 return BubbleBorder::TOP_CENTER; |
321 default: | 321 default: |
322 return BubbleBorder::NONE; | 322 return BubbleBorder::NONE; |
323 } | 323 } |
324 } | 324 } |
325 | 325 |
326 } // namespace views | 326 } // namespace views |
OLD | NEW |