| Index: ash/common/system/tray/tray_utils.cc
|
| diff --git a/ash/common/system/tray/tray_utils.cc b/ash/common/system/tray/tray_utils.cc
|
| index 1fd780b073f7e56197b219b9d220a69bf5cbee16..9dc1faa37ac0c60a40a6d1eb51d4ad5a25fd381b 100644
|
| --- a/ash/common/system/tray/tray_utils.cc
|
| +++ b/ash/common/system/tray/tray_utils.cc
|
| @@ -4,21 +4,49 @@
|
|
|
| #include "ash/common/system/tray/tray_utils.h"
|
|
|
| +#include "ash/common/ash_constants.h"
|
| #include "ash/common/material_design/material_design_controller.h"
|
| #include "ash/common/session/session_state_delegate.h"
|
| #include "ash/common/shelf/wm_shelf_util.h"
|
| #include "ash/common/system/tray/tray_constants.h"
|
| #include "ash/common/system/tray/tray_item_view.h"
|
| +#include "ash/common/system/tray/tray_popup_label_button_border.h"
|
| #include "ash/common/wm_shell.h"
|
| #include "ui/accessibility/ax_view_state.h"
|
| #include "ui/gfx/font_list.h"
|
| #include "ui/gfx/geometry/vector2d.h"
|
| #include "ui/views/border.h"
|
| +#include "ui/views/controls/button/label_button.h"
|
| +#include "ui/views/controls/button/md_text_button.h"
|
| #include "ui/views/controls/label.h"
|
| #include "ui/views/controls/separator.h"
|
|
|
| namespace ash {
|
|
|
| +views::LabelButton* CreateTrayPopupBorderlessButton(
|
| + views::ButtonListener* listener,
|
| + const base::string16& text) {
|
| + auto* button = new views::LabelButton(listener, text);
|
| + button->SetBorder(
|
| + std::unique_ptr<views::Border>(new TrayPopupLabelButtonBorder));
|
| + button->SetFocusForPlatform();
|
| + button->set_animate_on_state_change(false);
|
| + button->SetHorizontalAlignment(gfx::ALIGN_CENTER);
|
| + button->SetFocusPainter(views::Painter::CreateSolidFocusPainter(
|
| + kFocusBorderColor, gfx::Insets(1, 1, 2, 2)));
|
| + return button;
|
| +}
|
| +
|
| +views::LabelButton* CreateTrayPopupButton(views::ButtonListener* listener,
|
| + const base::string16& text) {
|
| + if (!MaterialDesignController::IsSystemTrayMenuMaterial())
|
| + return CreateTrayPopupBorderlessButton(listener, text);
|
| +
|
| + auto* button = views::MdTextButton::Create(listener, text);
|
| + button->SetProminent(true);
|
| + return button;
|
| +}
|
| +
|
| void SetupLabelForTray(views::Label* label) {
|
| if (MaterialDesignController::IsShelfMaterial()) {
|
| // The text is drawn on an transparent bg, so we must disable subpixel
|
|
|