Chromium Code Reviews| Index: ui/views/controls/textfield/textfield.cc |
| diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc |
| index be796b27549a59f49444ee6261134903192ac70b..fc465a07f5c0c1341dd361dde34b285b3fa2a5ba 100644 |
| --- a/ui/views/controls/textfield/textfield.cc |
| +++ b/ui/views/controls/textfield/textfield.cc |
| @@ -17,6 +17,7 @@ |
| #include "ui/base/dragdrop/drag_utils.h" |
| #include "ui/base/ime/input_method.h" |
| #include "ui/base/ime/text_edit_commands.h" |
| +#include "ui/base/material_design/material_design_controller.h" |
| #include "ui/base/resource/resource_bundle.h" |
| #include "ui/base/ui_base_switches_util.h" |
| #include "ui/compositor/canvas_painter.h" |
| @@ -1732,12 +1733,18 @@ void Textfield::AccessibilitySetValue(const base::string16& new_value) { |
| void Textfield::UpdateBackgroundColor() { |
| const SkColor color = GetBackgroundColor(); |
| - set_background(Background::CreateSolidBackground(color)); |
| + if (false && ui::MaterialDesignController::IsSecondaryUiMaterial()) { |
|
tapted
2016/08/09 01:35:13
The `if (false &&` - may have crept in while traci
Evan Stade
2016/08/09 01:39:28
oh yea, whoops. Nice catch
|
| + set_background(Background::CreateBackgroundPainter( |
| + true, Painter::CreateSolidRoundRectPainter( |
| + color, FocusableBorder::kCornerRadiusDp))); |
| + } else { |
| + set_background(Background::CreateSolidBackground(color)); |
| + } |
| // Disable subpixel rendering when the background color is transparent |
| // because it draws incorrect colors around the glyphs in that case. |
| // See crbug.com/115198 |
| GetRenderText()->set_subpixel_rendering_suppressed( |
| - SkColorGetA(color) != 0xFF); |
| + SkColorGetA(color) != SK_AlphaOPAQUE); |
| SchedulePaint(); |
| } |