Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Side by Side Diff: ui/views/controls/menu/menu_scroll_view_container.cc

Issue 1513153002: Border::CreateBorderPainter now takes a unique_ptr, not a raw pointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@border-unittest
Patch Set: Rebase (rest of border switched to unique_ptr). Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/views/border.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/views/border.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698