| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 InkDropDelegate* ink_drop_delegate() const { | 130 InkDropDelegate* ink_drop_delegate() const { |
| 131 return ink_drop_delegate_.get(); | 131 return ink_drop_delegate_.get(); |
| 132 } | 132 } |
| 133 | 133 |
| 134 // Overridden from View: | 134 // Overridden from View: |
| 135 void OnBoundsChanged(const gfx::Rect& previous_bounds) override; | 135 void OnBoundsChanged(const gfx::Rect& previous_bounds) override; |
| 136 void ViewHierarchyChanged( | 136 void ViewHierarchyChanged( |
| 137 const ViewHierarchyChangedDetails& details) override; | 137 const ViewHierarchyChangedDetails& details) override; |
| 138 void OnBlur() override; | 138 void OnBlur() override; |
| 139 | 139 |
| 140 // Overridden from Button: |
| 141 void NotifyClick(const ui::Event& event) override; |
| 142 void OnClickCanceled(const ui::Event& event) override; |
| 143 |
| 140 // The button state (defined in implementation) | 144 // The button state (defined in implementation) |
| 141 ButtonState state_; | 145 ButtonState state_; |
| 142 | 146 |
| 143 // Hover animation. | 147 // Hover animation. |
| 144 scoped_ptr<gfx::ThrobAnimation> hover_animation_; | 148 scoped_ptr<gfx::ThrobAnimation> hover_animation_; |
| 145 | 149 |
| 146 private: | 150 private: |
| 147 // Returns true if this is not a top level widget. Virtual for tests. | 151 // Returns true if this is not a top level widget. Virtual for tests. |
| 148 virtual bool IsChildWidget() const; | 152 virtual bool IsChildWidget() const; |
| 149 // Returns true if the focus is not in a top level widget. Virtual for tests. | 153 // Returns true if the focus is not in a top level widget. Virtual for tests. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 166 | 170 |
| 167 // The event on which the button should notify its listener. | 171 // The event on which the button should notify its listener. |
| 168 NotifyAction notify_action_; | 172 NotifyAction notify_action_; |
| 169 | 173 |
| 170 DISALLOW_COPY_AND_ASSIGN(CustomButton); | 174 DISALLOW_COPY_AND_ASSIGN(CustomButton); |
| 171 }; | 175 }; |
| 172 | 176 |
| 173 } // namespace views | 177 } // namespace views |
| 174 | 178 |
| 175 #endif // UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ | 179 #endif // UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ |
| OLD | NEW |