Chromium Code Reviews| 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 #ifndef UI_VIEWS_ANIMATION_INK_DROP_H_ | 5 #ifndef UI_VIEWS_ANIMATION_INK_DROP_H_ |
| 6 #define UI_VIEWS_ANIMATION_INK_DROP_H_ | 6 #define UI_VIEWS_ANIMATION_INK_DROP_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 12 #include "ui/compositor/layer_tree_owner.h" | 12 #include "ui/compositor/layer_tree_owner.h" |
| 13 #include "ui/events/event_handler.h" | 13 #include "ui/events/event_handler.h" |
| 14 #include "ui/gfx/geometry/rect.h" | 14 #include "ui/gfx/geometry/rect.h" |
| 15 #include "ui/gfx/geometry/size.h" | 15 #include "ui/gfx/geometry/size.h" |
| 16 #include "ui/views/animation/ink_drop_state.h" | 16 #include "ui/views/animation/ink_drop_state.h" |
| 17 #include "ui/views/views_export.h" | 17 #include "ui/views/views_export.h" |
| 18 | 18 |
| 19 namespace views { | 19 namespace views { |
| 20 | 20 |
| 21 // Pure virtual base class that manages the lifetime and state of an ink drop | 21 // Pure virtual base class that manages the lifetime and state of an ink drop |
| 22 // ripple as well as visual hover state feedback. | 22 // ripple as well as visual hover state feedback. |
| 23 class VIEWS_EXPORT InkDrop { | 23 class VIEWS_EXPORT InkDrop { |
| 24 public: | 24 public: |
| 25 virtual ~InkDrop() {} | 25 virtual ~InkDrop() {} |
| 26 | 26 |
| 27 // Used to update the layer size for the ink drop. | |
| 28 virtual void UpdateLayerSize(const gfx::Size& layer_size) = 0; | |
|
bruthig
2016/11/14 19:09:38
I think this would be better named as "HostSizeCha
mohsen
2016/11/14 20:19:39
Sure. Done.
| |
| 29 | |
| 27 // Gets the target state of the ink drop. | 30 // Gets the target state of the ink drop. |
| 28 virtual InkDropState GetTargetInkDropState() const = 0; | 31 virtual InkDropState GetTargetInkDropState() const = 0; |
| 29 | 32 |
| 30 // Animates from the current InkDropState to |ink_drop_state|. | 33 // Animates from the current InkDropState to |ink_drop_state|. |
| 31 virtual void AnimateToState(InkDropState ink_drop_state) = 0; | 34 virtual void AnimateToState(InkDropState ink_drop_state) = 0; |
| 32 | 35 |
| 33 // Immediately snaps the InkDropState to ACTIVATED. This more specific | 36 // Immediately snaps the InkDropState to ACTIVATED. This more specific |
| 34 // implementation of the non-existent SnapToState(InkDropState) function is | 37 // implementation of the non-existent SnapToState(InkDropState) function is |
| 35 // the only one available because it was the only InkDropState that clients | 38 // the only one available because it was the only InkDropState that clients |
| 36 // needed to skip animations for. | 39 // needed to skip animations for. |
| 37 virtual void SnapToActivated() = 0; | 40 virtual void SnapToActivated() = 0; |
| 38 | 41 |
| 39 // Enables or disables the hover state. | 42 // Enables or disables the hover state. |
| 40 virtual void SetHovered(bool is_hovered) = 0; | 43 virtual void SetHovered(bool is_hovered) = 0; |
| 41 | 44 |
| 42 // Enables or disables the focus state. | 45 // Enables or disables the focus state. |
| 43 virtual void SetFocused(bool is_focused) = 0; | 46 virtual void SetFocused(bool is_focused) = 0; |
| 44 | 47 |
| 45 protected: | 48 protected: |
| 46 InkDrop() {} | 49 InkDrop() {} |
| 47 | 50 |
| 48 private: | 51 private: |
| 49 DISALLOW_COPY_AND_ASSIGN(InkDrop); | 52 DISALLOW_COPY_AND_ASSIGN(InkDrop); |
| 50 }; | 53 }; |
| 51 | 54 |
| 52 } // namespace views | 55 } // namespace views |
| 53 | 56 |
| 54 #endif // UI_VIEWS_ANIMATION_INK_DROP_H_ | 57 #endif // UI_VIEWS_ANIMATION_INK_DROP_H_ |
| OLD | NEW |