Chromium Code Reviews| 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/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "ui/events/event_constants.h" | 9 #include "ui/events/event_constants.h" |
| 10 #include "ui/gfx/animation/animation_delegate.h" | 10 #include "ui/gfx/animation/animation_delegate.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 113 | 113 |
| 114 // Returns true if the event is one that can trigger notifying the listener. | 114 // Returns true if the event is one that can trigger notifying the listener. |
| 115 // This implementation returns true if the left mouse button is down. | 115 // This implementation returns true if the left mouse button is down. |
| 116 virtual bool IsTriggerableEvent(const ui::Event& event); | 116 virtual bool IsTriggerableEvent(const ui::Event& event); |
| 117 | 117 |
| 118 // Returns true if the button should become pressed when the user | 118 // Returns true if the button should become pressed when the user |
| 119 // holds the mouse down over the button. For this implementation, | 119 // holds the mouse down over the button. For this implementation, |
| 120 // we simply return IsTriggerableEvent(event). | 120 // we simply return IsTriggerableEvent(event). |
| 121 virtual bool ShouldEnterPushedState(const ui::Event& event); | 121 virtual bool ShouldEnterPushedState(const ui::Event& event); |
| 122 | 122 |
| 123 // If true, handles accelerator events when the widget associated with this | |
| 124 // button is inactive. In-menu buttons in the hamburger menu such as zoom and | |
|
msw
2015/12/23 04:06:25
"Menu widgets are inactive, but buttons therein (e
meacer
2015/12/24 21:40:02
Done.
| |
| 125 // cut/copy/paste are inactive, but they should still handle accelerators. | |
| 126 virtual bool ShouldHandleAcceleratorWhenInactive(); | |
| 127 | |
| 123 // Returns true if the button should enter hovered state; that is, if the | 128 // Returns true if the button should enter hovered state; that is, if the |
| 124 // mouse is over the button, and no other window has capture (which would | 129 // mouse is over the button, and no other window has capture (which would |
| 125 // prevent the button from receiving MouseExited events and updating its | 130 // prevent the button from receiving MouseExited events and updating its |
| 126 // state). This does not take into account enabled state. | 131 // state). This does not take into account enabled state. |
| 127 bool ShouldEnterHoveredState(); | 132 bool ShouldEnterHoveredState(); |
| 128 | 133 |
| 129 InkDropDelegate* ink_drop_delegate() const { return ink_drop_delegate_; } | 134 InkDropDelegate* ink_drop_delegate() const { return ink_drop_delegate_; } |
| 130 void set_ink_drop_delegate(InkDropDelegate* ink_drop_delegate) { | 135 void set_ink_drop_delegate(InkDropDelegate* ink_drop_delegate) { |
| 131 ink_drop_delegate_ = ink_drop_delegate; | 136 ink_drop_delegate_ = ink_drop_delegate; |
| 132 } | 137 } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 168 | 173 |
| 169 // The event on which the button should notify its listener. | 174 // The event on which the button should notify its listener. |
| 170 NotifyAction notify_action_; | 175 NotifyAction notify_action_; |
| 171 | 176 |
| 172 DISALLOW_COPY_AND_ASSIGN(CustomButton); | 177 DISALLOW_COPY_AND_ASSIGN(CustomButton); |
| 173 }; | 178 }; |
| 174 | 179 |
| 175 } // namespace views | 180 } // namespace views |
| 176 | 181 |
| 177 #endif // UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ | 182 #endif // UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ |
| OLD | NEW |