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

Side by Side Diff: ui/views/animation/ink_drop_host_view.cc

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_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/animation/ink_drop_host_view.h ('k') | ui/views/animation/ink_drop_hover.h » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/animation/ink_drop_host_view.h" 5 #include "ui/views/animation/ink_drop_host_view.h"
6 6
7 #include "ui/gfx/color_palette.h" 7 #include "ui/gfx/color_palette.h"
8 #include "ui/views/animation/ink_drop_hover.h" 8 #include "ui/views/animation/ink_drop_hover.h"
9 #include "ui/views/animation/square_ink_drop_animation.h" 9 #include "ui/views/animation/square_ink_drop_animation.h"
10 10
(...skipping 16 matching lines...) Expand all
27 layer()->SetFillsBoundsOpaquely(false); 27 layer()->SetFillsBoundsOpaquely(false);
28 layer()->Add(ink_drop_layer); 28 layer()->Add(ink_drop_layer);
29 layer()->StackAtBottom(ink_drop_layer); 29 layer()->StackAtBottom(ink_drop_layer);
30 } 30 }
31 31
32 void InkDropHostView::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { 32 void InkDropHostView::RemoveInkDropLayer(ui::Layer* ink_drop_layer) {
33 layer()->Remove(ink_drop_layer); 33 layer()->Remove(ink_drop_layer);
34 SetPaintToLayer(false); 34 SetPaintToLayer(false);
35 } 35 }
36 36
37 scoped_ptr<InkDropAnimation> InkDropHostView::CreateInkDropAnimation() const { 37 std::unique_ptr<InkDropAnimation> InkDropHostView::CreateInkDropAnimation()
38 const {
38 gfx::Size large_drop(ink_drop_size_.width() * 4 / 3, 39 gfx::Size large_drop(ink_drop_size_.width() * 4 / 3,
39 ink_drop_size_.height() * 4 / 3); 40 ink_drop_size_.height() * 4 / 3);
40 41
41 scoped_ptr<InkDropAnimation> animation(new SquareInkDropAnimation( 42 std::unique_ptr<InkDropAnimation> animation(new SquareInkDropAnimation(
42 large_drop, kInkDropLargeCornerRadius, ink_drop_size_, 43 large_drop, kInkDropLargeCornerRadius, ink_drop_size_,
43 kInkDropSmallCornerRadius, GetInkDropCenter(), GetInkDropBaseColor())); 44 kInkDropSmallCornerRadius, GetInkDropCenter(), GetInkDropBaseColor()));
44 return animation; 45 return animation;
45 } 46 }
46 47
47 scoped_ptr<InkDropHover> InkDropHostView::CreateInkDropHover() const { 48 std::unique_ptr<InkDropHover> InkDropHostView::CreateInkDropHover() const {
48 scoped_ptr<InkDropHover> hover( 49 std::unique_ptr<InkDropHover> hover(
49 new InkDropHover(ink_drop_size_, kInkDropSmallCornerRadius, 50 new InkDropHover(ink_drop_size_, kInkDropSmallCornerRadius,
50 GetInkDropCenter(), GetInkDropBaseColor())); 51 GetInkDropCenter(), GetInkDropBaseColor()));
51 return hover; 52 return hover;
52 } 53 }
53 54
54 gfx::Point InkDropHostView::GetInkDropCenter() const { 55 gfx::Point InkDropHostView::GetInkDropCenter() const {
55 return GetLocalBounds().CenterPoint(); 56 return GetLocalBounds().CenterPoint();
56 } 57 }
57 58
58 SkColor InkDropHostView::GetInkDropBaseColor() const { 59 SkColor InkDropHostView::GetInkDropBaseColor() const {
59 NOTREACHED(); 60 NOTREACHED();
60 return gfx::kPlaceholderColor; 61 return gfx::kPlaceholderColor;
61 } 62 }
62 63
63 } // namespace views 64 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/animation/ink_drop_host_view.h ('k') | ui/views/animation/ink_drop_hover.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698