Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Unified Diff: ui/views/controls/button/label_button_border.cc

Issue 132023010: linux_aura: Fixes a couple of issues with the button border integration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: msw Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/views/controls/button/label_button_border.cc
diff --git a/ui/views/controls/button/label_button_border.cc b/ui/views/controls/button/label_button_border.cc
index 03912fffcc21b89136a1556f6b2d5d8821d5c111..23e9319ded38c9325e7aba3972ea1f4836cc469e 100644
--- a/ui/views/controls/button/label_button_border.cc
+++ b/ui/views/controls/button/label_button_border.cc
@@ -31,17 +31,6 @@ const int kButtonInsets = 5;
const int kTextHoveredImages[] = IMAGE_GRID(IDR_TEXTBUTTON_HOVER);
const int kTextPressedImages[] = IMAGE_GRID(IDR_TEXTBUTTON_PRESSED);
-Button::ButtonState GetButtonState(ui::NativeTheme::State state) {
- switch (state) {
- case ui::NativeTheme::kDisabled: return Button::STATE_DISABLED;
- case ui::NativeTheme::kHovered: return Button::STATE_HOVERED;
- case ui::NativeTheme::kNormal: return Button::STATE_NORMAL;
- case ui::NativeTheme::kPressed: return Button::STATE_PRESSED;
- case ui::NativeTheme::kMaxState: NOTREACHED() << "Unknown state: " << state;
- }
- return Button::STATE_NORMAL;
-}
-
// A helper function to paint the appropriate broder images.
void PaintHelper(LabelButtonBorder* border,
gfx::Canvas* canvas,
@@ -49,10 +38,11 @@ void PaintHelper(LabelButtonBorder* border,
const gfx::Rect& rect,
const ui::NativeTheme::ExtraParams& extra) {
Painter* painter =
- border->GetPainter(extra.button.is_focused, GetButtonState(state));
+ border->GetPainter(extra.button.is_focused,
+ Button::GetButtonStateFrom(state));
msw 2014/01/24 23:57:17 nit: drop the Button:: qualifiers here and below a
Elliot Glaysher 2014/01/25 00:38:19 I verified that I can't do this. Not in scope.
// Paint any corresponding unfocused painter if there is no focused painter.
if (!painter && extra.button.is_focused)
- painter = border->GetPainter(false, GetButtonState(state));
+ painter = border->GetPainter(false, Button::GetButtonStateFrom(state));
if (painter)
Painter::PaintPainterAt(canvas, painter, rect);
}

Powered by Google App Engine
This is Rietveld 408576698