Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Unified Diff: ash/common/system/tray/tray_utils.cc

Issue 2463163002: Update chromeos system menu buttons for MD. (Closed)
Patch Set: boxlayout has some annoying dchecks Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/common/system/tray/tray_utils.h ('k') | ash/common/system/tray_accessibility.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ash/common/system/tray/tray_utils.h ('k') | ash/common/system/tray_accessibility.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698