| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ | 5 #ifndef VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ |
| 6 #define VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ | 6 #define VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "app/animation.h" | 9 #include "app/animation.h" |
| 10 #include "views/controls/button/button.h" | 10 #include "views/controls/button/button.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 // we simply return IsTriggerableEvent(e). | 96 // we simply return IsTriggerableEvent(e). |
| 97 virtual bool ShouldEnterPushedState(const MouseEvent& e); | 97 virtual bool ShouldEnterPushedState(const MouseEvent& e); |
| 98 | 98 |
| 99 // The button state (defined in implementation) | 99 // The button state (defined in implementation) |
| 100 ButtonState state_; | 100 ButtonState state_; |
| 101 | 101 |
| 102 // Hover animation. | 102 // Hover animation. |
| 103 scoped_ptr<ThrobAnimation> hover_animation_; | 103 scoped_ptr<ThrobAnimation> hover_animation_; |
| 104 | 104 |
| 105 private: | 105 private: |
| 106 // Set / test whether the button is highlighted (in the hover state). | |
| 107 void SetHighlighted(bool highlighted); | |
| 108 bool IsHighlighted() const; | |
| 109 | |
| 110 // Returns whether the button is pushed. | |
| 111 bool IsPushed() const; | |
| 112 | |
| 113 // Should we animate when the state changes? Defaults to true, but false while | 106 // Should we animate when the state changes? Defaults to true, but false while |
| 114 // throbbing. | 107 // throbbing. |
| 115 bool animate_on_state_change_; | 108 bool animate_on_state_change_; |
| 116 | 109 |
| 117 // Mouse event flags which can trigger button actions. | 110 // Mouse event flags which can trigger button actions. |
| 118 int triggerable_event_flags_; | 111 int triggerable_event_flags_; |
| 119 | 112 |
| 120 // See description above setter. | 113 // See description above setter. |
| 121 bool request_focus_on_press_; | 114 bool request_focus_on_press_; |
| 122 | 115 |
| 123 DISALLOW_COPY_AND_ASSIGN(CustomButton); | 116 DISALLOW_COPY_AND_ASSIGN(CustomButton); |
| 124 }; | 117 }; |
| 125 | 118 |
| 126 } // namespace views | 119 } // namespace views |
| 127 | 120 |
| 128 #endif // VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ | 121 #endif // VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ |
| OLD | NEW |