| 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 "ui/base/material_design/material_design_controller.h" | 8 #include "ui/base/material_design/material_design_controller.h" |
| 9 #include "ui/gfx/canvas.h" | 9 #include "ui/gfx/canvas.h" |
| 10 #include "ui/gfx/color_palette.h" | 10 #include "ui/gfx/color_palette.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 } | 123 } |
| 124 | 124 |
| 125 std::unique_ptr<InkDrop> MdTextButton::CreateInkDrop() { | 125 std::unique_ptr<InkDrop> MdTextButton::CreateInkDrop() { |
| 126 return CreateDefaultFloodFillInkDropImpl(); | 126 return CreateDefaultFloodFillInkDropImpl(); |
| 127 } | 127 } |
| 128 | 128 |
| 129 std::unique_ptr<views::InkDropRipple> MdTextButton::CreateInkDropRipple() | 129 std::unique_ptr<views::InkDropRipple> MdTextButton::CreateInkDropRipple() |
| 130 const { | 130 const { |
| 131 return std::unique_ptr<views::InkDropRipple>( | 131 return std::unique_ptr<views::InkDropRipple>( |
| 132 new views::FloodFillInkDropRipple( | 132 new views::FloodFillInkDropRipple( |
| 133 GetLocalBounds(), GetInkDropCenterBasedOnLastEvent(), | 133 size(), GetInkDropCenterBasedOnLastEvent(), GetInkDropBaseColor(), |
| 134 GetInkDropBaseColor(), ink_drop_visible_opacity())); | 134 ink_drop_visible_opacity())); |
| 135 } | 135 } |
| 136 | 136 |
| 137 void MdTextButton::StateChanged() { | 137 void MdTextButton::StateChanged() { |
| 138 LabelButton::StateChanged(); | 138 LabelButton::StateChanged(); |
| 139 UpdateColors(); | 139 UpdateColors(); |
| 140 } | 140 } |
| 141 | 141 |
| 142 std::unique_ptr<views::InkDropHighlight> MdTextButton::CreateInkDropHighlight() | 142 std::unique_ptr<views::InkDropHighlight> MdTextButton::CreateInkDropHighlight() |
| 143 const { | 143 const { |
| 144 // The prominent button hover effect is a shadow. | 144 // The prominent button hover effect is a shadow. |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 stroke_color, gfx::kDisabledControlAlpha); | 293 stroke_color, gfx::kDisabledControlAlpha); |
| 294 } | 294 } |
| 295 | 295 |
| 296 DCHECK_EQ(SK_AlphaOPAQUE, static_cast<int>(SkColorGetA(bg_color))); | 296 DCHECK_EQ(SK_AlphaOPAQUE, static_cast<int>(SkColorGetA(bg_color))); |
| 297 set_background(Background::CreateBackgroundPainter( | 297 set_background(Background::CreateBackgroundPainter( |
| 298 true, Painter::CreateRoundRectWith1PxBorderPainter( | 298 true, Painter::CreateRoundRectWith1PxBorderPainter( |
| 299 bg_color, stroke_color, kInkDropSmallCornerRadius))); | 299 bg_color, stroke_color, kInkDropSmallCornerRadius))); |
| 300 } | 300 } |
| 301 | 301 |
| 302 } // namespace views | 302 } // namespace views |
| OLD | NEW |