OLD | NEW |
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 Loading... |
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 |
OLD | NEW |