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 27 matching lines...) Expand all Loading... | |
| 38 // ripple is hidden the highlight will be made visible again if the | 38 // ripple is hidden the highlight will be made visible again if the |
| 39 // hover/focus settings deem it should be. | 39 // hover/focus settings deem it should be. |
| 40 HIDE_ON_RIPPLE, | 40 HIDE_ON_RIPPLE, |
| 41 // The highlight is made visible when the ripple becomes visible. After the | 41 // The highlight is made visible when the ripple becomes visible. After the |
| 42 // ripple is hidden the highlight will be hidden again if the hover/focus | 42 // ripple is hidden the highlight will be hidden again if the hover/focus |
| 43 // settings deem it should be. | 43 // settings deem it should be. |
| 44 SHOW_ON_RIPPLE, | 44 SHOW_ON_RIPPLE, |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 // Constructs an ink drop that will attach the ink drop to the given | 47 // Constructs an ink drop that will attach the ink drop to the given |
| 48 // |ink_drop_host|. | 48 // |ink_drop_host|. |layer_size| determines size of the ink drop layer and |
| 49 // should match the host size; | |
| 49 // | 50 // |
| 50 // By default the highlight will be made visible while |this| is hovered but | 51 // By default the highlight will be made visible while |this| is hovered but |
| 51 // not focused and the NONE AutoHighlightMode will be used. | 52 // not focused and the NONE AutoHighlightMode will be used. |
| 52 explicit InkDropImpl(InkDropHost* ink_drop_host); | 53 InkDropImpl(InkDropHost* ink_drop_host, const gfx::Size& layer_size); |
|
bruthig
2016/11/14 19:09:38
nit: Rename |layer_size| as |host_size|. Clients
mohsen
2016/11/14 20:19:39
Done.
| |
| 53 ~InkDropImpl() override; | 54 ~InkDropImpl() override; |
| 54 | 55 |
| 55 void SetShowHighlightOnHover(bool show_highlight_on_hover); | 56 void SetShowHighlightOnHover(bool show_highlight_on_hover); |
| 56 | 57 |
| 57 void SetShowHighlightOnFocus(bool show_highlight_on_focus); | 58 void SetShowHighlightOnFocus(bool show_highlight_on_focus); |
| 58 | 59 |
| 59 // Auto highlighting is a mechanism to show/hide the highlight based on the | 60 // Auto highlighting is a mechanism to show/hide the highlight based on the |
| 60 // visibility of the ripple. See the documentation of the AutoHighlightMode | 61 // visibility of the ripple. See the documentation of the AutoHighlightMode |
| 61 // for more info on the different modes. | 62 // for more info on the different modes. |
| 62 // | 63 // |
| 63 // This method is intended as a configuration option to be used after | 64 // This method is intended as a configuration option to be used after |
| 64 // construction. Behavior is undefined if |this| has already handled any | 65 // construction. Behavior is undefined if |this| has already handled any |
| 65 // InkDrop inherited functions. | 66 // InkDrop inherited functions. |
| 66 void SetAutoHighlightMode(AutoHighlightMode auto_highlight_mode); | 67 void SetAutoHighlightMode(AutoHighlightMode auto_highlight_mode); |
| 67 | 68 |
| 68 // InkDrop: | 69 // InkDrop: |
| 70 void UpdateLayerSize(const gfx::Size& layer_size) override; | |
| 69 InkDropState GetTargetInkDropState() const override; | 71 InkDropState GetTargetInkDropState() const override; |
| 70 void AnimateToState(InkDropState ink_drop_state) override; | 72 void AnimateToState(InkDropState ink_drop_state) override; |
| 71 void SnapToActivated() override; | 73 void SnapToActivated() override; |
| 72 void SetHovered(bool is_hovered) override; | 74 void SetHovered(bool is_hovered) override; |
| 73 void SetFocused(bool is_focused) override; | 75 void SetFocused(bool is_focused) override; |
| 74 | 76 |
| 75 private: | 77 private: |
| 76 friend class InkDropImplTest; | 78 friend class InkDropImplTest; |
| 77 friend class test::InkDropImplTestApi; | 79 friend class test::InkDropImplTestApi; |
| 78 | 80 |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 310 | 312 |
| 311 // Used to fail DCHECKS to catch unexpected behavior during tear down. | 313 // Used to fail DCHECKS to catch unexpected behavior during tear down. |
| 312 bool destroying_; | 314 bool destroying_; |
| 313 | 315 |
| 314 DISALLOW_COPY_AND_ASSIGN(InkDropImpl); | 316 DISALLOW_COPY_AND_ASSIGN(InkDropImpl); |
| 315 }; | 317 }; |
| 316 | 318 |
| 317 } // namespace views | 319 } // namespace views |
| 318 | 320 |
| 319 #endif // UI_VIEWS_ANIMATION_INK_DROP_IMPL_H_ | 321 #endif // UI_VIEWS_ANIMATION_INK_DROP_IMPL_H_ |
| OLD | NEW |