| 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 "third_party/skia/include/core/SkPaint.h" | 9 #include "third_party/skia/include/core/SkPaint.h" |
| 9 #include "third_party/skia/include/core/SkPath.h" | 10 #include "third_party/skia/include/core/SkPath.h" |
| 10 #include "ui/accessibility/ax_view_state.h" | 11 #include "ui/accessibility/ax_view_state.h" |
| 11 #include "ui/gfx/canvas.h" | 12 #include "ui/gfx/canvas.h" |
| 12 #include "ui/gfx/color_palette.h" | 13 #include "ui/gfx/color_palette.h" |
| 13 #include "ui/views/border.h" | 14 #include "ui/views/border.h" |
| 14 #include "ui/views/bubble/bubble_border.h" | 15 #include "ui/views/bubble/bubble_border.h" |
| 15 #include "ui/views/controls/menu/menu_config.h" | 16 #include "ui/views/controls/menu/menu_config.h" |
| 16 #include "ui/views/controls/menu/menu_controller.h" | 17 #include "ui/views/controls/menu/menu_controller.h" |
| 17 #include "ui/views/controls/menu/menu_item_view.h" | 18 #include "ui/views/controls/menu/menu_item_view.h" |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 int left = menu_config.menu_horizontal_border_size + padding; | 287 int left = menu_config.menu_horizontal_border_size + padding; |
| 287 int bottom = menu_config.menu_vertical_border_size + padding; | 288 int bottom = menu_config.menu_vertical_border_size + padding; |
| 288 int right = menu_config.menu_horizontal_border_size + padding; | 289 int right = menu_config.menu_horizontal_border_size + padding; |
| 289 | 290 |
| 290 if (menu_config.use_outer_border) { | 291 if (menu_config.use_outer_border) { |
| 291 SkColor color = GetNativeTheme() | 292 SkColor color = GetNativeTheme() |
| 292 ? GetNativeTheme()->GetSystemColor( | 293 ? GetNativeTheme()->GetSystemColor( |
| 293 ui::NativeTheme::kColorId_MenuBorderColor) | 294 ui::NativeTheme::kColorId_MenuBorderColor) |
| 294 : gfx::kPlaceholderColor; | 295 : gfx::kPlaceholderColor; |
| 295 SetBorder(views::Border::CreateBorderPainter( | 296 SetBorder(views::Border::CreateBorderPainter( |
| 296 new views::RoundRectPainter(color, menu_config.corner_radius), | 297 base::WrapUnique( |
| 298 new views::RoundRectPainter(color, menu_config.corner_radius)), |
| 297 gfx::Insets(top, left, bottom, right))); | 299 gfx::Insets(top, left, bottom, right))); |
| 298 } else { | 300 } else { |
| 299 SetBorder(Border::CreateEmptyBorder(top, left, bottom, right)); | 301 SetBorder(Border::CreateEmptyBorder(top, left, bottom, right)); |
| 300 } | 302 } |
| 301 } | 303 } |
| 302 | 304 |
| 303 void MenuScrollViewContainer::CreateBubbleBorder() { | 305 void MenuScrollViewContainer::CreateBubbleBorder() { |
| 304 bubble_border_ = new BubbleBorder(arrow_, | 306 bubble_border_ = new BubbleBorder(arrow_, |
| 305 BubbleBorder::SMALL_SHADOW, | 307 BubbleBorder::SMALL_SHADOW, |
| 306 SK_ColorWHITE); | 308 SK_ColorWHITE); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 318 case MENU_ANCHOR_BUBBLE_ABOVE: | 320 case MENU_ANCHOR_BUBBLE_ABOVE: |
| 319 return BubbleBorder::BOTTOM_CENTER; | 321 return BubbleBorder::BOTTOM_CENTER; |
| 320 case MENU_ANCHOR_BUBBLE_BELOW: | 322 case MENU_ANCHOR_BUBBLE_BELOW: |
| 321 return BubbleBorder::TOP_CENTER; | 323 return BubbleBorder::TOP_CENTER; |
| 322 default: | 324 default: |
| 323 return BubbleBorder::NONE; | 325 return BubbleBorder::NONE; |
| 324 } | 326 } |
| 325 } | 327 } |
| 326 | 328 |
| 327 } // namespace views | 329 } // namespace views |
| OLD | NEW |