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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
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 = NativeTheme::ExtraParams(); |
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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 case MENU_ANCHOR_BUBBLE_ABOVE: | 321 case MENU_ANCHOR_BUBBLE_ABOVE: |
323 return BubbleBorder::BOTTOM_CENTER; | 322 return BubbleBorder::BOTTOM_CENTER; |
324 case MENU_ANCHOR_BUBBLE_BELOW: | 323 case MENU_ANCHOR_BUBBLE_BELOW: |
325 return BubbleBorder::TOP_CENTER; | 324 return BubbleBorder::TOP_CENTER; |
326 default: | 325 default: |
327 return BubbleBorder::NONE; | 326 return BubbleBorder::NONE; |
328 } | 327 } |
329 } | 328 } |
330 | 329 |
331 } // namespace views | 330 } // namespace views |
OLD | NEW |