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 #include "ui/views/controls/button/label_button.h" | 5 #include "ui/views/controls/button/label_button.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "grit/ui_resources.h" | 8 #include "grit/ui_resources.h" |
9 #include "ui/base/animation/throb_animation.h" | 9 #include "ui/base/animation/throb_animation.h" |
10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 const int kSpacing = 5; | 24 const int kSpacing = 5; |
25 | 25 |
26 // The length of the hover fade animation. | 26 // The length of the hover fade animation. |
27 const int kHoverAnimationDurationMs = 170; | 27 const int kHoverAnimationDurationMs = 170; |
28 | 28 |
29 } // namespace | 29 } // namespace |
30 | 30 |
31 namespace views { | 31 namespace views { |
32 | 32 |
33 // static | 33 // static |
34 const char LabelButton::kViewClassName[] = "views/LabelButton"; | 34 const char LabelButton::kViewClassName[] = "LabelButton"; |
35 | 35 |
36 LabelButton::LabelButton(ButtonListener* listener, const string16& text) | 36 LabelButton::LabelButton(ButtonListener* listener, const string16& text) |
37 : CustomButton(listener), | 37 : CustomButton(listener), |
38 image_(new ImageView()), | 38 image_(new ImageView()), |
39 label_(new Label()), | 39 label_(new Label()), |
40 button_state_images_(), | 40 button_state_images_(), |
41 button_state_colors_(), | 41 button_state_colors_(), |
42 explicitly_set_colors_(), | 42 explicitly_set_colors_(), |
43 is_default_(false), | 43 is_default_(false), |
44 style_(STYLE_TEXTBUTTON) { | 44 style_(STYLE_TEXTBUTTON) { |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 params->button.indeterminate = false; | 330 params->button.indeterminate = false; |
331 params->button.is_default = is_default_; | 331 params->button.is_default = is_default_; |
332 params->button.is_focused = HasFocus() && IsAccessibilityFocusable(); | 332 params->button.is_focused = HasFocus() && IsAccessibilityFocusable(); |
333 params->button.has_border = style() == STYLE_NATIVE_TEXTBUTTON; | 333 params->button.has_border = style() == STYLE_NATIVE_TEXTBUTTON; |
334 params->button.classic_state = 0; | 334 params->button.classic_state = 0; |
335 params->button.background_color = GetNativeTheme()->GetSystemColor( | 335 params->button.background_color = GetNativeTheme()->GetSystemColor( |
336 ui::NativeTheme::kColorId_ButtonBackgroundColor); | 336 ui::NativeTheme::kColorId_ButtonBackgroundColor); |
337 } | 337 } |
338 | 338 |
339 } // namespace views | 339 } // namespace views |
OLD | NEW |