| 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 #include "ui/views/controls/button/custom_button.h" | 5 #include "ui/views/controls/button/custom_button.h" |
| 6 | 6 |
| 7 #include "ui/base/accessibility/accessible_view_state.h" | 7 #include "ui/base/accessibility/accessible_view_state.h" |
| 8 #include "ui/base/animation/throb_animation.h" | 8 #include "ui/base/animation/throb_animation.h" |
| 9 #include "ui/base/keycodes/keyboard_codes.h" | 9 #include "ui/base/keycodes/keyboard_codes.h" |
| 10 #include "ui/gfx/screen.h" | 10 #include "ui/gfx/screen.h" |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 | 272 |
| 273 //////////////////////////////////////////////////////////////////////////////// | 273 //////////////////////////////////////////////////////////////////////////////// |
| 274 // CustomButton, View overrides (protected): | 274 // CustomButton, View overrides (protected): |
| 275 | 275 |
| 276 void CustomButton::ViewHierarchyChanged(bool is_add, View *parent, | 276 void CustomButton::ViewHierarchyChanged(bool is_add, View *parent, |
| 277 View *child) { | 277 View *child) { |
| 278 if (!is_add && state_ != BS_DISABLED) | 278 if (!is_add && state_ != BS_DISABLED) |
| 279 SetState(BS_NORMAL); | 279 SetState(BS_NORMAL); |
| 280 } | 280 } |
| 281 | 281 |
| 282 bool CustomButton::IsFocusable() const { | |
| 283 return (state_ != BS_DISABLED) && View::IsFocusable(); | |
| 284 } | |
| 285 | |
| 286 void CustomButton::OnBlur() { | 282 void CustomButton::OnBlur() { |
| 287 if (IsHotTracked()) | 283 if (IsHotTracked()) |
| 288 SetState(BS_NORMAL); | 284 SetState(BS_NORMAL); |
| 289 } | 285 } |
| 290 | 286 |
| 291 } // namespace views | 287 } // namespace views |
| OLD | NEW |