| 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 149 |
| 150 // Overridden from Button: | 150 // Overridden from Button: |
| 151 void NotifyClick(const ui::Event& event) override; | 151 void NotifyClick(const ui::Event& event) override; |
| 152 void OnClickCanceled(const ui::Event& event) override; | 152 void OnClickCanceled(const ui::Event& event) override; |
| 153 | 153 |
| 154 const gfx::ThrobAnimation& hover_animation() const { | 154 const gfx::ThrobAnimation& hover_animation() const { |
| 155 return hover_animation_; | 155 return hover_animation_; |
| 156 } | 156 } |
| 157 | 157 |
| 158 private: | 158 private: |
| 159 // Returns true if this is not a top level widget. Virtual for tests. | |
| 160 virtual bool IsChildWidget() const; | |
| 161 // Returns true if the focus is not in a top level widget. Virtual for tests. | |
| 162 virtual bool FocusInChildWidget() const; | |
| 163 | |
| 164 ButtonState state_; | 159 ButtonState state_; |
| 165 | 160 |
| 166 gfx::ThrobAnimation hover_animation_; | 161 gfx::ThrobAnimation hover_animation_; |
| 167 | 162 |
| 168 // Should we animate when the state changes? Defaults to true. | 163 // Should we animate when the state changes? Defaults to true. |
| 169 bool animate_on_state_change_; | 164 bool animate_on_state_change_; |
| 170 | 165 |
| 171 // Is the hover animation running because StartThrob was invoked? | 166 // Is the hover animation running because StartThrob was invoked? |
| 172 bool is_throbbing_; | 167 bool is_throbbing_; |
| 173 | 168 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 193 // The animation action to trigger on the |ink_drop_delegate_| when the button | 188 // The animation action to trigger on the |ink_drop_delegate_| when the button |
| 194 // is clicked. | 189 // is clicked. |
| 195 InkDropState ink_drop_action_on_click_; | 190 InkDropState ink_drop_action_on_click_; |
| 196 | 191 |
| 197 DISALLOW_COPY_AND_ASSIGN(CustomButton); | 192 DISALLOW_COPY_AND_ASSIGN(CustomButton); |
| 198 }; | 193 }; |
| 199 | 194 |
| 200 } // namespace views | 195 } // namespace views |
| 201 | 196 |
| 202 #endif // UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ | 197 #endif // UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ |
| OLD | NEW |