Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/md_text_button.h" | 5 #include "ui/views/controls/button/md_text_button.h" |
| 6 | 6 |
| 7 #include "base/i18n/case_conversion.h" | 7 #include "base/i18n/case_conversion.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "ui/base/material_design/material_design_controller.h" | 9 #include "ui/base/material_design/material_design_controller.h" |
| 10 #include "ui/gfx/canvas.h" | 10 #include "ui/gfx/canvas.h" |
| 11 #include "ui/gfx/color_palette.h" | 11 #include "ui/gfx/color_palette.h" |
| 12 #include "ui/gfx/color_utils.h" | 12 #include "ui/gfx/color_utils.h" |
| 13 #include "ui/native_theme/native_theme.h" | 13 #include "ui/native_theme/native_theme.h" |
| 14 #include "ui/views/animation/flood_fill_ink_drop_ripple.h" | 14 #include "ui/views/animation/flood_fill_ink_drop_ripple.h" |
| 15 #include "ui/views/animation/ink_drop_highlight.h" | 15 #include "ui/views/animation/ink_drop_highlight.h" |
| 16 #include "ui/views/animation/ink_drop_impl.h" | 16 #include "ui/views/animation/ink_drop_impl.h" |
| 17 #include "ui/views/animation/ink_drop_painted_layer_delegates.h" | 17 #include "ui/views/animation/ink_drop_painted_layer_delegates.h" |
| 18 #include "ui/views/background.h" | 18 #include "ui/views/background.h" |
| 19 #include "ui/views/border.h" | 19 #include "ui/views/border.h" |
| 20 #include "ui/views/controls/button/blue_button.h" | 20 #include "ui/views/controls/button/blue_button.h" |
| 21 #include "ui/views/controls/focus_ring.h" | 21 #include "ui/views/controls/focus_ring.h" |
| 22 #include "ui/views/painter.h" | 22 #include "ui/views/painter.h" |
| 23 #include "ui/views/style/platform_style.h" | 23 #include "ui/views/style/platform_style.h" |
| 24 | 24 |
| 25 namespace views { | 25 namespace views { |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 // Minimum size to reserve for the button contents. | 29 // Minimum size to reserve for the button contents. |
| 30 const int kMinWidth = 48; | 30 const int kMinWidth = 64; |
|
Peter Kasting
2017/02/06 21:44:51
Nit: I think this should be 4 * HarmonyLayoutDeleg
Bret
2017/02/09 00:49:49
Since I'm adding this to LayoutDelegate anyway I j
| |
| 31 | 31 |
| 32 LabelButton* CreateButton(ButtonListener* listener, | 32 LabelButton* CreateButton(ButtonListener* listener, |
| 33 const base::string16& text, | 33 const base::string16& text, |
| 34 bool md) { | 34 bool md) { |
| 35 if (md) | 35 if (md) |
| 36 return MdTextButton::Create(listener, text); | 36 return MdTextButton::Create(listener, text); |
| 37 | 37 |
| 38 LabelButton* button = new LabelButton(listener, text); | 38 LabelButton* button = new LabelButton(listener, text); |
| 39 button->SetStyle(CustomButton::STYLE_BUTTON); | 39 button->SetStyle(CustomButton::STYLE_BUTTON); |
| 40 return button; | 40 return button; |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 297 stroke_color, gfx::kDisabledControlAlpha); | 297 stroke_color, gfx::kDisabledControlAlpha); |
| 298 } | 298 } |
| 299 | 299 |
| 300 DCHECK_EQ(SK_AlphaOPAQUE, static_cast<int>(SkColorGetA(bg_color))); | 300 DCHECK_EQ(SK_AlphaOPAQUE, static_cast<int>(SkColorGetA(bg_color))); |
| 301 set_background(Background::CreateBackgroundPainter( | 301 set_background(Background::CreateBackgroundPainter( |
| 302 Painter::CreateRoundRectWith1PxBorderPainter(bg_color, stroke_color, | 302 Painter::CreateRoundRectWith1PxBorderPainter(bg_color, stroke_color, |
| 303 kInkDropSmallCornerRadius))); | 303 kInkDropSmallCornerRadius))); |
| 304 } | 304 } |
| 305 | 305 |
| 306 } // namespace views | 306 } // namespace views |
| OLD | NEW |