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" |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 namespace { | 28 namespace { |
29 | 29 |
30 LabelButton* CreateButton(ButtonListener* listener, | 30 LabelButton* CreateButton(ButtonListener* listener, |
31 const base::string16& text, | 31 const base::string16& text, |
32 bool md) { | 32 bool md) { |
33 if (md) | 33 if (md) |
34 return MdTextButton::Create(listener, text); | 34 return MdTextButton::Create(listener, text); |
35 | 35 |
36 LabelButton* button = new LabelButton(listener, text); | 36 LabelButton* button = new LabelButton(listener, text); |
37 button->SetStyle(CustomButton::STYLE_BUTTON); | 37 button->SetStyleDeprecated(CustomButton::STYLE_BUTTON); |
38 return button; | 38 return button; |
39 } | 39 } |
40 | 40 |
41 const gfx::FontList& GetMdFontList() { | 41 const gfx::FontList& GetMdFontList() { |
42 static base::LazyInstance<gfx::FontList>::Leaky font_list = | 42 static base::LazyInstance<gfx::FontList>::Leaky font_list = |
43 LAZY_INSTANCE_INITIALIZER; | 43 LAZY_INSTANCE_INITIALIZER; |
44 const gfx::Font::Weight min_weight = gfx::Font::Weight::MEDIUM; | 44 const gfx::Font::Weight min_weight = gfx::Font::Weight::MEDIUM; |
45 if (font_list.Get().GetFontWeight() < min_weight) | 45 if (font_list.Get().GetFontWeight() < min_weight) |
46 font_list.Get() = font_list.Get().DeriveWithWeight(min_weight); | 46 font_list.Get() = font_list.Get().DeriveWithWeight(min_weight); |
47 return font_list.Get(); | 47 return font_list.Get(); |
(...skipping 249 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 |