| Index: ui/views/controls/button/custom_button.cc
|
| diff --git a/ui/views/controls/button/custom_button.cc b/ui/views/controls/button/custom_button.cc
|
| index f864f5ee08df1708b6daf3d81331b7fae2670c34..9a0e28a65a5e92a62935741c130cbb0fb2dd4962 100644
|
| --- a/ui/views/controls/button/custom_button.cc
|
| +++ b/ui/views/controls/button/custom_button.cc
|
| @@ -52,15 +52,7 @@ class MdFocusRing : public views::View {
|
| ~MdFocusRing() override {}
|
|
|
| void OnPaint(gfx::Canvas* canvas) override {
|
| - SkPaint paint;
|
| - paint.setAntiAlias(true);
|
| - paint.setColor(GetNativeTheme()->GetSystemColor(
|
| - ui::NativeTheme::kColorId_CallToActionColor));
|
| - paint.setStyle(SkPaint::kStroke_Style);
|
| - paint.setStrokeWidth(1);
|
| - gfx::RectF rect(GetLocalBounds());
|
| - rect.Inset(gfx::InsetsF(0.5));
|
| - canvas->DrawRoundRect(rect, kFocusBorderCornerRadius, paint);
|
| + CustomButton::PaintMdFocusRing(canvas, this);
|
| }
|
|
|
| private:
|
| @@ -77,9 +69,10 @@ const char CustomButton::kViewClassName[] = "CustomButton";
|
|
|
| // static
|
| const CustomButton* CustomButton::AsCustomButton(const views::View* view) {
|
| - return AsCustomButton(const_cast<views::View*>(view));
|
| + return AsCustomButton(const_cast<View*>(view));
|
| }
|
|
|
| +// static
|
| CustomButton* CustomButton::AsCustomButton(views::View* view) {
|
| if (view) {
|
| const char* classname = view->GetClassName();
|
| @@ -95,6 +88,19 @@ CustomButton* CustomButton::AsCustomButton(views::View* view) {
|
| return NULL;
|
| }
|
|
|
| +// static
|
| +void CustomButton::PaintMdFocusRing(gfx::Canvas* canvas, views::View* view) {
|
| + SkPaint paint;
|
| + paint.setAntiAlias(true);
|
| + paint.setColor(view->GetNativeTheme()->GetSystemColor(
|
| + ui::NativeTheme::kColorId_CallToActionColor));
|
| + paint.setStyle(SkPaint::kStroke_Style);
|
| + paint.setStrokeWidth(1);
|
| + gfx::RectF rect(view->GetLocalBounds());
|
| + rect.Inset(gfx::InsetsF(0.5));
|
| + canvas->DrawRoundRect(rect, kFocusBorderCornerRadius, paint);
|
| +}
|
| +
|
| CustomButton::~CustomButton() {}
|
|
|
| void CustomButton::SetState(ButtonState state) {
|
|
|