| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_animation_controller_factory.h" | 5 #include "ui/views/animation/ink_drop_animation_controller_factory.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "ui/base/material_design/material_design_controller.h" | 8 #include "ui/base/material_design/material_design_controller.h" |
| 9 #include "ui/gfx/geometry/rect.h" | 9 #include "ui/gfx/geometry/rect.h" |
| 10 #include "ui/gfx/geometry/size.h" | 10 #include "ui/gfx/geometry/size.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 public: | 23 public: |
| 24 explicit InkDropAnimationControllerStub(); | 24 explicit InkDropAnimationControllerStub(); |
| 25 ~InkDropAnimationControllerStub() override; | 25 ~InkDropAnimationControllerStub() override; |
| 26 | 26 |
| 27 // InkDropAnimationController: | 27 // InkDropAnimationController: |
| 28 InkDropState GetInkDropState() const override; | 28 InkDropState GetInkDropState() const override; |
| 29 bool IsVisible() const override; | 29 bool IsVisible() const override; |
| 30 void AnimateToState(InkDropState state) override; | 30 void AnimateToState(InkDropState state) override; |
| 31 void SetHovered(bool is_hovered) override; | 31 void SetHovered(bool is_hovered) override; |
| 32 bool IsHovered() const override; | 32 bool IsHovered() const override; |
| 33 gfx::Size GetInkDropLargeSize() const override; | |
| 34 void SetInkDropSize(const gfx::Size& large_size, | 33 void SetInkDropSize(const gfx::Size& large_size, |
| 35 int large_corner_radius, | 34 int large_corner_radius, |
| 36 const gfx::Size& small_size, | 35 const gfx::Size& small_size, |
| 37 int small_corner_radius) override; | 36 int small_corner_radius) override; |
| 38 void SetInkDropCenter(const gfx::Point& center_point) override; | 37 void SetInkDropCenter(const gfx::Point& center_point) override; |
| 39 | 38 |
| 40 private: | 39 private: |
| 41 // Tracks whether the ink drop is hovered or not. This is used to ensure that | 40 // Tracks whether the ink drop is hovered or not. This is used to ensure that |
| 42 // this behaves like all other InkDropAnimationController implementations. | 41 // this behaves like all other InkDropAnimationController implementations. |
| 43 bool is_hovered_; | 42 bool is_hovered_; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 63 } | 62 } |
| 64 | 63 |
| 65 void InkDropAnimationControllerStub::SetHovered(bool is_hovered) { | 64 void InkDropAnimationControllerStub::SetHovered(bool is_hovered) { |
| 66 is_hovered_ = is_hovered; | 65 is_hovered_ = is_hovered; |
| 67 } | 66 } |
| 68 | 67 |
| 69 bool InkDropAnimationControllerStub::IsHovered() const { | 68 bool InkDropAnimationControllerStub::IsHovered() const { |
| 70 return is_hovered_; | 69 return is_hovered_; |
| 71 } | 70 } |
| 72 | 71 |
| 73 gfx::Size InkDropAnimationControllerStub::GetInkDropLargeSize() const { | |
| 74 return gfx::Size(); | |
| 75 } | |
| 76 | |
| 77 void InkDropAnimationControllerStub::SetInkDropSize(const gfx::Size& large_size, | 72 void InkDropAnimationControllerStub::SetInkDropSize(const gfx::Size& large_size, |
| 78 int large_corner_radius, | 73 int large_corner_radius, |
| 79 const gfx::Size& small_size, | 74 const gfx::Size& small_size, |
| 80 int small_corner_radius) {} | 75 int small_corner_radius) {} |
| 81 | 76 |
| 82 void InkDropAnimationControllerStub::SetInkDropCenter( | 77 void InkDropAnimationControllerStub::SetInkDropCenter( |
| 83 const gfx::Point& center_point) {} | 78 const gfx::Point& center_point) {} |
| 84 | 79 |
| 85 } // namespace | 80 } // namespace |
| 86 | 81 |
| 87 InkDropAnimationControllerFactory::InkDropAnimationControllerFactory() {} | 82 InkDropAnimationControllerFactory::InkDropAnimationControllerFactory() {} |
| 88 | 83 |
| 89 InkDropAnimationControllerFactory::~InkDropAnimationControllerFactory() {} | 84 InkDropAnimationControllerFactory::~InkDropAnimationControllerFactory() {} |
| 90 | 85 |
| 91 scoped_ptr<InkDropAnimationController> | 86 scoped_ptr<InkDropAnimationController> |
| 92 InkDropAnimationControllerFactory::CreateInkDropAnimationController( | 87 InkDropAnimationControllerFactory::CreateInkDropAnimationController( |
| 93 InkDropHost* ink_drop_host) { | 88 InkDropHost* ink_drop_host) { |
| 94 if (ui::MaterialDesignController::IsModeMaterial()) { | 89 if (ui::MaterialDesignController::IsModeMaterial()) { |
| 95 return scoped_ptr<InkDropAnimationController>( | 90 return scoped_ptr<InkDropAnimationController>( |
| 96 new InkDropAnimationControllerImpl(ink_drop_host)); | 91 new InkDropAnimationControllerImpl(ink_drop_host)); |
| 97 } | 92 } |
| 98 | 93 |
| 99 return scoped_ptr<InkDropAnimationController>( | 94 return scoped_ptr<InkDropAnimationController>( |
| 100 new InkDropAnimationControllerStub()); | 95 new InkDropAnimationControllerStub()); |
| 101 } | 96 } |
| 102 | 97 |
| 103 } // namespace views | 98 } // namespace views |
| OLD | NEW |