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

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

Issue 2259753003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/controls/button/md_text_button.cc ('k') | ui/views/mus/native_widget_mus.cc » ('j') | 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 "base/memory/ptr_util.h"
9 #include "third_party/skia/include/core/SkPaint.h" 9 #include "third_party/skia/include/core/SkPaint.h"
10 #include "third_party/skia/include/core/SkPath.h" 10 #include "third_party/skia/include/core/SkPath.h"
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 int left = menu_config.menu_horizontal_border_size + padding; 287 int left = menu_config.menu_horizontal_border_size + padding;
288 int bottom = menu_config.menu_vertical_border_size + padding; 288 int bottom = menu_config.menu_vertical_border_size + padding;
289 int right = menu_config.menu_horizontal_border_size + padding; 289 int right = menu_config.menu_horizontal_border_size + padding;
290 290
291 if (menu_config.use_outer_border) { 291 if (menu_config.use_outer_border) {
292 SkColor color = GetNativeTheme() 292 SkColor color = GetNativeTheme()
293 ? GetNativeTheme()->GetSystemColor( 293 ? GetNativeTheme()->GetSystemColor(
294 ui::NativeTheme::kColorId_MenuBorderColor) 294 ui::NativeTheme::kColorId_MenuBorderColor)
295 : gfx::kPlaceholderColor; 295 : gfx::kPlaceholderColor;
296 SetBorder(views::Border::CreateBorderPainter( 296 SetBorder(views::Border::CreateBorderPainter(
297 base::WrapUnique( 297 base::MakeUnique<views::RoundRectPainter>(color,
298 new views::RoundRectPainter(color, menu_config.corner_radius)), 298 menu_config.corner_radius),
299 gfx::Insets(top, left, bottom, right))); 299 gfx::Insets(top, left, bottom, right)));
300 } else { 300 } else {
301 SetBorder(Border::CreateEmptyBorder(top, left, bottom, right)); 301 SetBorder(Border::CreateEmptyBorder(top, left, bottom, right));
302 } 302 }
303 } 303 }
304 304
305 void MenuScrollViewContainer::CreateBubbleBorder() { 305 void MenuScrollViewContainer::CreateBubbleBorder() {
306 bubble_border_ = new BubbleBorder(arrow_, 306 bubble_border_ = new BubbleBorder(arrow_,
307 BubbleBorder::SMALL_SHADOW, 307 BubbleBorder::SMALL_SHADOW,
308 SK_ColorWHITE); 308 SK_ColorWHITE);
(...skipping 11 matching lines...) Expand all
320 case MENU_ANCHOR_BUBBLE_ABOVE: 320 case MENU_ANCHOR_BUBBLE_ABOVE:
321 return BubbleBorder::BOTTOM_CENTER; 321 return BubbleBorder::BOTTOM_CENTER;
322 case MENU_ANCHOR_BUBBLE_BELOW: 322 case MENU_ANCHOR_BUBBLE_BELOW:
323 return BubbleBorder::TOP_CENTER; 323 return BubbleBorder::TOP_CENTER;
324 default: 324 default:
325 return BubbleBorder::NONE; 325 return BubbleBorder::NONE;
326 } 326 }
327 } 327 }
328 328
329 } // namespace views 329 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/md_text_button.cc ('k') | ui/views/mus/native_widget_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698