| 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 "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 83 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 cc::PaintFlags paint; | 104 cc::PaintFlags flags; |
| 105 paint.setStyle(cc::PaintFlags::kFill_Style); | 105 flags.setStyle(cc::PaintFlags::kFill_Style); |
| 106 paint.setAntiAlias(true); | 106 flags.setAntiAlias(true); |
| 107 paint.setColor(config.arrow_color); | 107 flags.setColor(config.arrow_color); |
| 108 canvas->DrawPath(path, paint); | 108 canvas->DrawPath(path, flags); |
| 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. |
| 116 bool is_up_; | 116 bool is_up_; |
| 117 | 117 |
| 118 // Preferred height. | 118 // Preferred height. |
| (...skipping 198 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 |