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_IMPL_H_ | 5 #ifndef UI_VIEWS_ANIMATION_INK_DROP_IMPL_H_ |
| 6 #define UI_VIEWS_ANIMATION_INK_DROP_IMPL_H_ | 6 #define UI_VIEWS_ANIMATION_INK_DROP_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 65 // InkDrop inherited functions. | 65 // InkDrop inherited functions. |
| 66 void SetAutoHighlightMode(AutoHighlightMode auto_highlight_mode); | 66 void SetAutoHighlightMode(AutoHighlightMode auto_highlight_mode); |
| 67 | 67 |
| 68 // InkDrop: | 68 // InkDrop: |
| 69 void HostSizeChanged(const gfx::Size& new_size) override; | 69 void HostSizeChanged(const gfx::Size& new_size) override; |
| 70 InkDropState GetTargetInkDropState() const override; | 70 InkDropState GetTargetInkDropState() const override; |
| 71 void AnimateToState(InkDropState ink_drop_state) override; | 71 void AnimateToState(InkDropState ink_drop_state) override; |
| 72 void SnapToActivated() override; | 72 void SnapToActivated() override; |
| 73 void SetHovered(bool is_hovered) override; | 73 void SetHovered(bool is_hovered) override; |
| 74 void SetFocused(bool is_focused) override; | 74 void SetFocused(bool is_focused) override; |
| 75 bool ShouldHighlight() const override; | |
|
bruthig
2017/03/08 18:58:24
If we decide to keep ShouldHighlight() as a virtua
spqchan
2017/03/14 00:07:52
Used IsHighlightFadingInOrVisible() instead. Let m
| |
| 75 | 76 |
| 76 private: | 77 private: |
| 77 friend class InkDropImplTest; | 78 friend class InkDropImplTest; |
| 78 friend class test::InkDropImplTestApi; | 79 friend class test::InkDropImplTestApi; |
| 79 | 80 |
| 80 // Forward declaration for use by the HighlightState class definition. | 81 // Forward declaration for use by the HighlightState class definition. |
| 81 class HighlightStateFactory; | 82 class HighlightStateFactory; |
| 82 | 83 |
| 83 // Base HighlightState defines functions to handle all state changes that may | 84 // Base HighlightState defines functions to handle all state changes that may |
| 84 // affect the highlight state. | 85 // affect the highlight state. |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 238 InkDropAnimationEndedReason reason) override; | 239 InkDropAnimationEndedReason reason) override; |
| 239 | 240 |
| 240 // Enables or disables the highlight state based on |should_highlight| and if | 241 // Enables or disables the highlight state based on |should_highlight| and if |
| 241 // an animation is triggered it will be scheduled to have the given | 242 // an animation is triggered it will be scheduled to have the given |
| 242 // |animation_duration|. If |explode| is true the highlight will expand as it | 243 // |animation_duration|. If |explode| is true the highlight will expand as it |
| 243 // fades out. |explode| is ignored when |should_higlight| is true. | 244 // fades out. |explode| is ignored when |should_higlight| is true. |
| 244 void SetHighlight(bool should_highlight, | 245 void SetHighlight(bool should_highlight, |
| 245 base::TimeDelta animation_duration, | 246 base::TimeDelta animation_duration, |
| 246 bool explode); | 247 bool explode); |
| 247 | 248 |
| 248 // Returns true if |this| the highlight should be visible based on the | |
| 249 // hover/focus status. | |
| 250 bool ShouldHighlight() const; | |
| 251 | |
| 252 // Returns true if |this| the hilight should be visible based on the focus | 249 // Returns true if |this| the hilight should be visible based on the focus |
| 253 // status. | 250 // status. |
| 254 bool ShouldHighlightBasedOnFocus() const; | 251 bool ShouldHighlightBasedOnFocus() const; |
| 255 | 252 |
| 256 // Updates the current |highlight_state_|. Calls Exit()/Enter() on the | 253 // Updates the current |highlight_state_|. Calls Exit()/Enter() on the |
| 257 // previous/new state to notify them of the transition. | 254 // previous/new state to notify them of the transition. |
| 258 // | 255 // |
| 259 // Uses ExitHighlightState() to exit the current state. | 256 // Uses ExitHighlightState() to exit the current state. |
| 260 void SetHighlightState(std::unique_ptr<HighlightState> highlight_state); | 257 void SetHighlightState(std::unique_ptr<HighlightState> highlight_state); |
| 261 | 258 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 311 | 308 |
| 312 // Used to fail DCHECKS to catch unexpected behavior during tear down. | 309 // Used to fail DCHECKS to catch unexpected behavior during tear down. |
| 313 bool destroying_; | 310 bool destroying_; |
| 314 | 311 |
| 315 DISALLOW_COPY_AND_ASSIGN(InkDropImpl); | 312 DISALLOW_COPY_AND_ASSIGN(InkDropImpl); |
| 316 }; | 313 }; |
| 317 | 314 |
| 318 } // namespace views | 315 } // namespace views |
| 319 | 316 |
| 320 #endif // UI_VIEWS_ANIMATION_INK_DROP_IMPL_H_ | 317 #endif // UI_VIEWS_ANIMATION_INK_DROP_IMPL_H_ |
| OLD | NEW |