| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ | 5 #ifndef UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ |
| 6 #define UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ | 6 #define UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "ui/events/event_constants.h" | 10 #include "ui/events/event_constants.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 ui::MenuSourceType source_type) override; | 96 ui::MenuSourceType source_type) override; |
| 97 void OnDragDone() override; | 97 void OnDragDone() override; |
| 98 void GetAccessibleState(ui::AXViewState* state) override; | 98 void GetAccessibleState(ui::AXViewState* state) override; |
| 99 void VisibilityChanged(View* starting_from, bool is_visible) override; | 99 void VisibilityChanged(View* starting_from, bool is_visible) override; |
| 100 scoped_ptr<InkDropHover> CreateInkDropHover() const override; | 100 scoped_ptr<InkDropHover> CreateInkDropHover() const override; |
| 101 SkColor GetInkDropBaseColor() const override; | 101 SkColor GetInkDropBaseColor() const override; |
| 102 | 102 |
| 103 // Overridden from gfx::AnimationDelegate: | 103 // Overridden from gfx::AnimationDelegate: |
| 104 void AnimationProgressed(const gfx::Animation* animation) override; | 104 void AnimationProgressed(const gfx::Animation* animation) override; |
| 105 | 105 |
| 106 InkDropDelegate* ink_drop_delegate() const { return ink_drop_delegate_; } |
| 107 |
| 106 protected: | 108 protected: |
| 107 // Construct the Button with a Listener. See comment for Button's ctor. | 109 // Construct the Button with a Listener. See comment for Button's ctor. |
| 108 explicit CustomButton(ButtonListener* listener); | 110 explicit CustomButton(ButtonListener* listener); |
| 109 | 111 |
| 110 // Invoked from SetState() when SetState() is passed a value that differs from | 112 // Invoked from SetState() when SetState() is passed a value that differs from |
| 111 // the current state. CustomButton's implementation of StateChanged() does | 113 // the current state. CustomButton's implementation of StateChanged() does |
| 112 // nothing; this method is provided for subclasses that wish to do something | 114 // nothing; this method is provided for subclasses that wish to do something |
| 113 // on state changes. | 115 // on state changes. |
| 114 virtual void StateChanged(); | 116 virtual void StateChanged(); |
| 115 | 117 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 128 void set_has_ink_drop_action_on_click(bool has_ink_drop_action_on_click) { | 130 void set_has_ink_drop_action_on_click(bool has_ink_drop_action_on_click) { |
| 129 has_ink_drop_action_on_click_ = has_ink_drop_action_on_click; | 131 has_ink_drop_action_on_click_ = has_ink_drop_action_on_click; |
| 130 } | 132 } |
| 131 | 133 |
| 132 // Returns true if the button should enter hovered state; that is, if the | 134 // Returns true if the button should enter hovered state; that is, if the |
| 133 // mouse is over the button, and no other window has capture (which would | 135 // mouse is over the button, and no other window has capture (which would |
| 134 // prevent the button from receiving MouseExited events and updating its | 136 // prevent the button from receiving MouseExited events and updating its |
| 135 // state). This does not take into account enabled state. | 137 // state). This does not take into account enabled state. |
| 136 bool ShouldEnterHoveredState(); | 138 bool ShouldEnterHoveredState(); |
| 137 | 139 |
| 138 InkDropDelegate* ink_drop_delegate() const { return ink_drop_delegate_; } | |
| 139 void set_ink_drop_delegate(InkDropDelegate* ink_drop_delegate) { | 140 void set_ink_drop_delegate(InkDropDelegate* ink_drop_delegate) { |
| 140 ink_drop_delegate_ = ink_drop_delegate; | 141 ink_drop_delegate_ = ink_drop_delegate; |
| 141 } | 142 } |
| 142 | 143 |
| 143 // Overridden from View: | 144 // Overridden from View: |
| 144 void ViewHierarchyChanged( | 145 void ViewHierarchyChanged( |
| 145 const ViewHierarchyChangedDetails& details) override; | 146 const ViewHierarchyChangedDetails& details) override; |
| 146 void OnBlur() override; | 147 void OnBlur() override; |
| 147 | 148 |
| 148 // Overridden from Button: | 149 // Overridden from Button: |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 190 |
| 190 // The color of the ripple and hover. | 191 // The color of the ripple and hover. |
| 191 SkColor ink_drop_base_color_; | 192 SkColor ink_drop_base_color_; |
| 192 | 193 |
| 193 DISALLOW_COPY_AND_ASSIGN(CustomButton); | 194 DISALLOW_COPY_AND_ASSIGN(CustomButton); |
| 194 }; | 195 }; |
| 195 | 196 |
| 196 } // namespace views | 197 } // namespace views |
| 197 | 198 |
| 198 #endif // UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ | 199 #endif // UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ |
| OLD | NEW |