| 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/views/animation/ink_drop_hover.h" | 8 #include "ui/views/animation/ink_drop_hover.h" |
| 8 #include "ui/views/animation/square_ink_drop_animation.h" | 9 #include "ui/views/animation/square_ink_drop_animation.h" |
| 9 | 10 |
| 10 namespace views { | 11 namespace views { |
| 11 | 12 |
| 12 // Default sizes for ink drop effects. | 13 // Default sizes for ink drop effects. |
| 13 const int kInkDropLargeSize = 32; | 14 const int kInkDropLargeSize = 32; |
| 14 const int kInkDropLargeCornerRadius = 4; | 15 const int kInkDropLargeCornerRadius = 4; |
| 15 const int kInkDropSmallSize = 24; | 16 const int kInkDropSmallSize = 24; |
| 16 const int kInkDropSmallCornerRadius = 2; | 17 const int kInkDropSmallCornerRadius = 2; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 30 layer()->Remove(ink_drop_layer); | 31 layer()->Remove(ink_drop_layer); |
| 31 SetFillsBoundsOpaquely(true); | 32 SetFillsBoundsOpaquely(true); |
| 32 SetPaintToLayer(false); | 33 SetPaintToLayer(false); |
| 33 } | 34 } |
| 34 | 35 |
| 35 scoped_ptr<InkDropAnimation> InkDropHostView::CreateInkDropAnimation() const { | 36 scoped_ptr<InkDropAnimation> InkDropHostView::CreateInkDropAnimation() const { |
| 36 scoped_ptr<InkDropAnimation> animation(new SquareInkDropAnimation( | 37 scoped_ptr<InkDropAnimation> animation(new SquareInkDropAnimation( |
| 37 gfx::Size(kInkDropLargeSize, kInkDropLargeSize), | 38 gfx::Size(kInkDropLargeSize, kInkDropLargeSize), |
| 38 kInkDropLargeCornerRadius, | 39 kInkDropLargeCornerRadius, |
| 39 gfx::Size(kInkDropSmallSize, kInkDropSmallSize), | 40 gfx::Size(kInkDropSmallSize, kInkDropSmallSize), |
| 40 kInkDropSmallCornerRadius)); | 41 kInkDropSmallCornerRadius, GetInkDropCenter(), GetInkDropBaseColor())); |
| 41 animation->SetCenterPoint(GetInkDropCenter()); | |
| 42 return animation; | 42 return animation; |
| 43 } | 43 } |
| 44 | 44 |
| 45 scoped_ptr<InkDropHover> InkDropHostView::CreateInkDropHover() const { | 45 scoped_ptr<InkDropHover> InkDropHostView::CreateInkDropHover() const { |
| 46 scoped_ptr<InkDropHover> hover( | 46 scoped_ptr<InkDropHover> hover(new InkDropHover( |
| 47 new InkDropHover(gfx::Size(kInkDropSmallSize, kInkDropSmallSize), | 47 gfx::Size(kInkDropSmallSize, kInkDropSmallSize), |
| 48 kInkDropSmallCornerRadius)); | 48 kInkDropSmallCornerRadius, GetInkDropCenter(), GetInkDropBaseColor())); |
| 49 hover->SetCenterPoint(GetInkDropCenter()); | |
| 50 return hover; | 49 return hover; |
| 51 } | 50 } |
| 52 | 51 |
| 53 gfx::Point InkDropHostView::GetInkDropCenter() const { | 52 gfx::Point InkDropHostView::GetInkDropCenter() const { |
| 54 return GetLocalBounds().CenterPoint(); | 53 return GetLocalBounds().CenterPoint(); |
| 55 } | 54 } |
| 56 | 55 |
| 56 SkColor InkDropHostView::GetInkDropBaseColor() const { |
| 57 NOTREACHED(); |
| 58 return gfx::kPlaceholderColor; |
| 59 } |
| 60 |
| 57 } // namespace views | 61 } // namespace views |
| OLD | NEW |