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 "views/controls/button/custom_button.h" | 5 #include "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" |
11 #include "views/widget/widget.h" | 11 #include "ui/views/widget/widget.h" |
12 | 12 |
13 namespace views { | 13 namespace views { |
14 | 14 |
15 // How long the hover animation takes if uninterrupted. | 15 // How long the hover animation takes if uninterrupted. |
16 static const int kHoverFadeDurationMs = 150; | 16 static const int kHoverFadeDurationMs = 150; |
17 | 17 |
18 // static | 18 // static |
19 const char CustomButton::kViewClassName[] = "views/CustomButton"; | 19 const char CustomButton::kViewClassName[] = "views/CustomButton"; |
20 | 20 |
21 //////////////////////////////////////////////////////////////////////////////// | 21 //////////////////////////////////////////////////////////////////////////////// |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 bool CustomButton::IsFocusable() const { | 286 bool CustomButton::IsFocusable() const { |
287 return (state_ != BS_DISABLED) && View::IsFocusable(); | 287 return (state_ != BS_DISABLED) && View::IsFocusable(); |
288 } | 288 } |
289 | 289 |
290 void CustomButton::OnBlur() { | 290 void CustomButton::OnBlur() { |
291 if (IsHotTracked()) | 291 if (IsHotTracked()) |
292 SetState(BS_NORMAL); | 292 SetState(BS_NORMAL); |
293 } | 293 } |
294 | 294 |
295 } // namespace views | 295 } // namespace views |
OLD | NEW |