| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "ui/base/animation/animation_delegate.h" | 9 #include "ui/base/animation/animation_delegate.h" |
| 10 #include "ui/views/controls/button/button.h" | 10 #include "ui/views/controls/button/button.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 111 |
| 112 // Returns true if the button should become pressed when the user | 112 // Returns true if the button should become pressed when the user |
| 113 // holds the mouse down over the button. For this implementation, | 113 // holds the mouse down over the button. For this implementation, |
| 114 // we simply return IsTriggerableEvent(event). | 114 // we simply return IsTriggerableEvent(event). |
| 115 virtual bool ShouldEnterPushedState(const MouseEvent& event); | 115 virtual bool ShouldEnterPushedState(const MouseEvent& event); |
| 116 | 116 |
| 117 // Overridden from View: | 117 // Overridden from View: |
| 118 virtual void ViewHierarchyChanged(bool is_add, | 118 virtual void ViewHierarchyChanged(bool is_add, |
| 119 View* parent, | 119 View* parent, |
| 120 View* child) OVERRIDE; | 120 View* child) OVERRIDE; |
| 121 virtual bool IsFocusable() const OVERRIDE; | |
| 122 virtual void OnBlur() OVERRIDE; | 121 virtual void OnBlur() OVERRIDE; |
| 123 | 122 |
| 124 // The button state (defined in implementation) | 123 // The button state (defined in implementation) |
| 125 ButtonState state_; | 124 ButtonState state_; |
| 126 | 125 |
| 127 // Hover animation. | 126 // Hover animation. |
| 128 scoped_ptr<ui::ThrobAnimation> hover_animation_; | 127 scoped_ptr<ui::ThrobAnimation> hover_animation_; |
| 129 | 128 |
| 130 private: | 129 private: |
| 131 // Should we animate when the state changes? Defaults to true. | 130 // Should we animate when the state changes? Defaults to true. |
| 132 bool animate_on_state_change_; | 131 bool animate_on_state_change_; |
| 133 | 132 |
| 134 // Is the hover animation running because StartThrob was invoked? | 133 // Is the hover animation running because StartThrob was invoked? |
| 135 bool is_throbbing_; | 134 bool is_throbbing_; |
| 136 | 135 |
| 137 // Mouse event flags which can trigger button actions. | 136 // Mouse event flags which can trigger button actions. |
| 138 int triggerable_event_flags_; | 137 int triggerable_event_flags_; |
| 139 | 138 |
| 140 // See description above setter. | 139 // See description above setter. |
| 141 bool request_focus_on_press_; | 140 bool request_focus_on_press_; |
| 142 | 141 |
| 143 DISALLOW_COPY_AND_ASSIGN(CustomButton); | 142 DISALLOW_COPY_AND_ASSIGN(CustomButton); |
| 144 }; | 143 }; |
| 145 | 144 |
| 146 } // namespace views | 145 } // namespace views |
| 147 | 146 |
| 148 #endif // UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ | 147 #endif // UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ |
| OLD | NEW |