| Index: ash/common/system/tray/tray_popup_utils.cc
|
| diff --git a/ash/common/system/tray/tray_popup_utils.cc b/ash/common/system/tray/tray_popup_utils.cc
|
| index f17cb55579bf98cc5b7ca2384bca19632b68a1f0..fef3d0cadb6a98de62648335d6a5b505e4ba5047 100644
|
| --- a/ash/common/system/tray/tray_popup_utils.cc
|
| +++ b/ash/common/system/tray/tray_popup_utils.cc
|
| @@ -117,13 +117,7 @@ class BorderlessLabelButton : public views::LabelButton {
|
| SetBorder(views::CreateEmptyBorder(gfx::Insets(0, kHorizontalPadding)));
|
| TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::BUTTON);
|
| style.SetupLabel(label());
|
| - // TODO(tdanderson): Update focus rect for material design. See
|
| - // crbug.com/615892
|
| - // Hack alert: CreateSolidFocusPainter should add 0.5f to all insets to
|
| - // make the lines align to pixel centers, but for now it doesn't. We can
|
| - // get around this by relying on Skia rounding up integer coordinates.
|
| - SetFocusPainter(views::Painter::CreateSolidFocusPainter(
|
| - kFocusBorderColor, gfx::Insets(0, 0, 1, 1)));
|
| + SetFocusPainter(TrayPopupUtils::CreateFocusPainter());
|
| } else {
|
| SetBorder(std::unique_ptr<views::Border>(new TrayPopupLabelButtonBorder));
|
| SetFocusPainter(views::Painter::CreateSolidFocusPainter(
|
| @@ -255,7 +249,6 @@ views::ImageView* TrayPopupUtils::CreateMoreImageView() {
|
| views::Slider* TrayPopupUtils::CreateSlider(views::SliderListener* listener) {
|
| const bool is_material = MaterialDesignController::IsSystemTrayMenuMaterial();
|
| views::Slider* slider = views::Slider::CreateSlider(is_material, listener);
|
| - slider->set_focus_border_color(kFocusBorderColor);
|
| if (is_material) {
|
| slider->SetBorder(
|
| views::CreateEmptyBorder(gfx::Insets(0, kTrayPopupSliderPaddingMD)));
|
| @@ -276,14 +269,18 @@ views::ToggleButton* TrayPopupUtils::CreateToggleButton(
|
| (kTrayToggleButtonWidth - toggle_size.width()) / 2;
|
| toggle->SetBorder(views::CreateEmptyBorder(
|
| gfx::Insets(vertical_padding, horizontal_padding)));
|
| - // TODO(tdanderson): Update the focus rect color, border thickness, and
|
| - // location for material design.
|
| - toggle->SetFocusPainter(views::Painter::CreateSolidFocusPainter(
|
| - kFocusBorderColor, gfx::Insets(1)));
|
| + // TODO(varkha): remove this and implement toggle-button specific focus. See
|
| + // crbug.com/669124
|
| + toggle->SetFocusPainter(CreateFocusPainter());
|
| toggle->SetAccessibleName(l10n_util::GetStringUTF16(accessible_name_id));
|
| return toggle;
|
| }
|
|
|
| +std::unique_ptr<views::Painter> TrayPopupUtils::CreateFocusPainter() {
|
| + return views::Painter::CreateSolidFocusPainter(
|
| + kFocusBorderColor, kFocusBorderThickness, gfx::InsetsF());
|
| +}
|
| +
|
| void TrayPopupUtils::ConfigureAsStickyHeader(views::View* view) {
|
| view->set_id(VIEW_ID_STICKY_HEADER);
|
| view->set_background(
|
|
|