OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/blue_button.h" | 5 #include "ui/views/controls/button/blue_button.h" |
6 | 6 |
7 #include "grit/ui_resources.h" | 7 #include "grit/ui_resources.h" |
8 #include "ui/base/accessibility/accessible_view_state.h" | 8 #include "ui/base/accessibility/accessible_view_state.h" |
9 #include "ui/base/resource/resource_bundle.h" | 9 #include "ui/base/resource/resource_bundle.h" |
10 #include "ui/gfx/sys_color_change_listener.h" | 10 #include "ui/gfx/sys_color_change_listener.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 *rb.GetImageSkiaNamed(IDR_BLUE_BUTTON_FOCUSED_NORMAL), insets)); | 56 *rb.GetImageSkiaNamed(IDR_BLUE_BUTTON_FOCUSED_NORMAL), insets)); |
57 button_border->SetPainter(true, STATE_HOVERED, | 57 button_border->SetPainter(true, STATE_HOVERED, |
58 Painter::CreateImagePainter( | 58 Painter::CreateImagePainter( |
59 *rb.GetImageSkiaNamed(IDR_BLUE_BUTTON_FOCUSED_HOVER), insets)); | 59 *rb.GetImageSkiaNamed(IDR_BLUE_BUTTON_FOCUSED_HOVER), insets)); |
60 button_border->SetPainter(true, STATE_PRESSED, | 60 button_border->SetPainter(true, STATE_PRESSED, |
61 Painter::CreateImagePainter( | 61 Painter::CreateImagePainter( |
62 *rb.GetImageSkiaNamed(IDR_BLUE_BUTTON_FOCUSED_PRESSED), insets)); | 62 *rb.GetImageSkiaNamed(IDR_BLUE_BUTTON_FOCUSED_PRESSED), insets)); |
63 button_border->SetPainter(true, STATE_DISABLED, | 63 button_border->SetPainter(true, STATE_DISABLED, |
64 Painter::CreateImagePainter( | 64 Painter::CreateImagePainter( |
65 *rb.GetImageSkiaNamed(IDR_BLUE_BUTTON_DISABLED), insets)); | 65 *rb.GetImageSkiaNamed(IDR_BLUE_BUTTON_DISABLED), insets)); |
| 66 } |
66 | 67 |
| 68 BlueButton::~BlueButton() {} |
| 69 |
| 70 void BlueButton::ResetColorsFromNativeTheme() { |
| 71 LabelButton::ResetColorsFromNativeTheme(); |
67 if (!gfx::IsInvertedColorScheme()) { | 72 if (!gfx::IsInvertedColorScheme()) { |
68 for (size_t state = STATE_NORMAL; state < STATE_COUNT; ++state) | 73 for (size_t state = STATE_NORMAL; state < STATE_COUNT; ++state) |
69 SetTextColor(static_cast<ButtonState>(state), kBlueButtonTextColor); | 74 SetTextColor(static_cast<ButtonState>(state), kBlueButtonTextColor); |
70 label()->SetShadowColors(kBlueButtonShadowColor, kBlueButtonShadowColor); | 75 label()->SetShadowColors(kBlueButtonShadowColor, kBlueButtonShadowColor); |
71 label()->SetShadowOffset(0, 1); | 76 label()->SetShadowOffset(0, 1); |
72 } | 77 } |
73 } | 78 } |
74 | 79 |
75 BlueButton::~BlueButton() {} | |
76 | |
77 const char* BlueButton::GetClassName() const { | 80 const char* BlueButton::GetClassName() const { |
78 return BlueButton::kViewClassName; | 81 return BlueButton::kViewClassName; |
79 } | 82 } |
80 | 83 |
81 } // namespace views | 84 } // namespace views |
OLD | NEW |