| 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 10 matching lines...) Expand all Loading... |
| 21 class InkDropAnimationControllerStub | 21 class InkDropAnimationControllerStub |
| 22 : public InkDropAnimationController { | 22 : public InkDropAnimationController { |
| 23 public: | 23 public: |
| 24 explicit InkDropAnimationControllerStub(); | 24 explicit InkDropAnimationControllerStub(); |
| 25 ~InkDropAnimationControllerStub() override; | 25 ~InkDropAnimationControllerStub() override; |
| 26 | 26 |
| 27 // InkDropAnimationController: | 27 // InkDropAnimationController: |
| 28 InkDropState GetTargetInkDropState() const override; | 28 InkDropState GetTargetInkDropState() 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 SnapToActivated() override; |
| 31 void SetHovered(bool is_hovered) override; | 32 void SetHovered(bool is_hovered) override; |
| 32 | 33 |
| 33 private: | 34 private: |
| 34 DISALLOW_COPY_AND_ASSIGN(InkDropAnimationControllerStub); | 35 DISALLOW_COPY_AND_ASSIGN(InkDropAnimationControllerStub); |
| 35 }; | 36 }; |
| 36 | 37 |
| 37 InkDropAnimationControllerStub::InkDropAnimationControllerStub() {} | 38 InkDropAnimationControllerStub::InkDropAnimationControllerStub() {} |
| 38 | 39 |
| 39 InkDropAnimationControllerStub::~InkDropAnimationControllerStub() {} | 40 InkDropAnimationControllerStub::~InkDropAnimationControllerStub() {} |
| 40 | 41 |
| 41 InkDropState InkDropAnimationControllerStub::GetTargetInkDropState() const { | 42 InkDropState InkDropAnimationControllerStub::GetTargetInkDropState() const { |
| 42 return InkDropState::HIDDEN; | 43 return InkDropState::HIDDEN; |
| 43 } | 44 } |
| 44 | 45 |
| 45 bool InkDropAnimationControllerStub::IsVisible() const { | 46 bool InkDropAnimationControllerStub::IsVisible() const { |
| 46 return false; | 47 return false; |
| 47 } | 48 } |
| 48 | 49 |
| 49 void InkDropAnimationControllerStub::AnimateToState(InkDropState state) {} | 50 void InkDropAnimationControllerStub::AnimateToState(InkDropState state) {} |
| 50 | 51 |
| 52 void InkDropAnimationControllerStub::SnapToActivated() {} |
| 53 |
| 51 void InkDropAnimationControllerStub::SetHovered(bool is_hovered) {} | 54 void InkDropAnimationControllerStub::SetHovered(bool is_hovered) {} |
| 52 | 55 |
| 53 } // namespace | 56 } // namespace |
| 54 | 57 |
| 55 InkDropAnimationControllerFactory::InkDropAnimationControllerFactory() {} | 58 InkDropAnimationControllerFactory::InkDropAnimationControllerFactory() {} |
| 56 | 59 |
| 57 InkDropAnimationControllerFactory::~InkDropAnimationControllerFactory() {} | 60 InkDropAnimationControllerFactory::~InkDropAnimationControllerFactory() {} |
| 58 | 61 |
| 59 scoped_ptr<InkDropAnimationController> | 62 scoped_ptr<InkDropAnimationController> |
| 60 InkDropAnimationControllerFactory::CreateInkDropAnimationController( | 63 InkDropAnimationControllerFactory::CreateInkDropAnimationController( |
| 61 InkDropHost* ink_drop_host) { | 64 InkDropHost* ink_drop_host) { |
| 62 if (ui::MaterialDesignController::IsModeMaterial()) { | 65 if (ui::MaterialDesignController::IsModeMaterial()) { |
| 63 return scoped_ptr<InkDropAnimationController>( | 66 return scoped_ptr<InkDropAnimationController>( |
| 64 new InkDropAnimationControllerImpl(ink_drop_host)); | 67 new InkDropAnimationControllerImpl(ink_drop_host)); |
| 65 } | 68 } |
| 66 | 69 |
| 67 return scoped_ptr<InkDropAnimationController>( | 70 return scoped_ptr<InkDropAnimationController>( |
| 68 new InkDropAnimationControllerStub()); | 71 new InkDropAnimationControllerStub()); |
| 69 } | 72 } |
| 70 | 73 |
| 71 } // namespace views | 74 } // namespace views |
| OLD | NEW |