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 "third_party/skia/include/core/SkPaint.h" | 8 #include "third_party/skia/include/core/SkPaint.h" |
9 #include "third_party/skia/include/core/SkPath.h" | 9 #include "third_party/skia/include/core/SkPath.h" |
10 #include "ui/accessibility/ax_view_state.h" | 10 #include "ui/accessibility/ax_view_state.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 int OnPerformDrop(const ui::DropTargetEvent& event) override { | 69 int OnPerformDrop(const ui::DropTargetEvent& event) override { |
70 return ui::DragDropTypes::DRAG_NONE; | 70 return ui::DragDropTypes::DRAG_NONE; |
71 } | 71 } |
72 | 72 |
73 void OnPaint(gfx::Canvas* canvas) override { | 73 void OnPaint(gfx::Canvas* canvas) override { |
74 const MenuConfig& config = MenuConfig::instance(); | 74 const MenuConfig& config = MenuConfig::instance(); |
75 | 75 |
76 // The background. | 76 // The background. |
77 gfx::Rect item_bounds(0, 0, width(), height()); | 77 gfx::Rect item_bounds(0, 0, width(), height()); |
78 NativeTheme::ExtraParams extra; | 78 NativeTheme::ExtraParams extra; |
79 extra.menu_item.is_selected = false; | |
80 GetNativeTheme()->Paint(canvas->sk_canvas(), | 79 GetNativeTheme()->Paint(canvas->sk_canvas(), |
81 NativeTheme::kMenuItemBackground, | 80 NativeTheme::kMenuItemBackground, |
82 NativeTheme::kNormal, item_bounds, extra); | 81 NativeTheme::kNormal, item_bounds, extra); |
83 | 82 |
84 // Then the arrow. | 83 // Then the arrow. |
85 int x = width() / 2; | 84 int x = width() / 2; |
86 int y = (height() - config.scroll_arrow_height) / 2; | 85 int y = (height() - config.scroll_arrow_height) / 2; |
87 | 86 |
88 int x_left = x - config.scroll_arrow_height; | 87 int x_left = x - config.scroll_arrow_height; |
89 int x_right = x + config.scroll_arrow_height; | 88 int x_right = x + config.scroll_arrow_height; |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 case MENU_ANCHOR_BUBBLE_ABOVE: | 318 case MENU_ANCHOR_BUBBLE_ABOVE: |
320 return BubbleBorder::BOTTOM_CENTER; | 319 return BubbleBorder::BOTTOM_CENTER; |
321 case MENU_ANCHOR_BUBBLE_BELOW: | 320 case MENU_ANCHOR_BUBBLE_BELOW: |
322 return BubbleBorder::TOP_CENTER; | 321 return BubbleBorder::TOP_CENTER; |
323 default: | 322 default: |
324 return BubbleBorder::NONE; | 323 return BubbleBorder::NONE; |
325 } | 324 } |
326 } | 325 } |
327 | 326 |
328 } // namespace views | 327 } // namespace views |
OLD | NEW |