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

Unified Diff: ash/common/system/chromeos/session/logout_button_tray.cc

Issue 2190453002: Update CrOS logout button for MD. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months 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 | « no previous file | ui/views/controls/button/md_text_button.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/chromeos/session/logout_button_tray.cc
diff --git a/ash/common/system/chromeos/session/logout_button_tray.cc b/ash/common/system/chromeos/session/logout_button_tray.cc
index ca18e32095f42947eb924ba59d348144e19d6869..6e63c91917832a69b64981287dcb8ba9e1ea5796 100644
--- a/ash/common/system/chromeos/session/logout_button_tray.cc
+++ b/ash/common/system/chromeos/session/logout_button_tray.cc
@@ -7,6 +7,7 @@
#include <memory>
#include <utility>
+#include "ash/common/material_design/material_design_controller.h"
#include "ash/common/shelf/shelf_types.h"
#include "ash/common/system/chromeos/session/logout_confirmation_controller.h"
#include "ash/common/system/tray/system_tray_delegate.h"
@@ -19,14 +20,17 @@
#include "grit/ash_resources.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/events/event.h"
+#include "ui/gfx/color_palette.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/size.h"
#include "ui/views/bubble/tray_bubble_view.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/controls/button/label_button_border.h"
+#include "ui/views/controls/button/md_text_button.h"
#include "ui/views/painter.h"
namespace ash {
+
namespace {
const int kLogoutButtonHorizontalExtraPadding = 7;
@@ -53,6 +57,7 @@ const int kLogoutButtonPushedImages[] = {
IDR_AURA_UBER_TRAY_LOGOUT_BUTTON_PUSHED_BOTTOM,
IDR_AURA_UBER_TRAY_LOGOUT_BUTTON_PUSHED_BOTTOM_RIGHT};
+// TODO(estade): LogoutButton is not used in MD; remove it when possible.
tdanderson 2016/07/27 14:24:57 We're using crbug.com/614453 to track all of the c
class LogoutButton : public views::LabelButton {
public:
LogoutButton(views::ButtonListener* listener);
@@ -95,10 +100,22 @@ LogoutButton::~LogoutButton() {}
LogoutButtonTray::LogoutButtonTray(WmShelf* wm_shelf)
: TrayBackgroundView(wm_shelf),
- button_(NULL),
+ button_(nullptr),
login_status_(LoginStatus::NOT_LOGGED_IN),
show_logout_button_in_tray_(false) {
- button_ = new LogoutButton(this);
+ if (MaterialDesignController::IsShelfMaterial()) {
+ views::MdTextButton* button =
+ views::MdTextButton::CreateMdButton(this, base::string16());
+ button->SetCallToAction(true);
+ button->set_bg_color_override(gfx::kGoogleRed700);
+ // Base font size + 2 = 14. TODO(estade): should this 2 be shared with other
tdanderson 2016/07/27 14:24:57 nit: TODO on new line Also, this falls under crbu
+ // tray views?
+ button->AdjustFontSize(2);
+ button->SetMinSize(gfx::Size(0, kTrayItemSize));
+ button_ = button;
+ } else {
+ button_ = new LogoutButton(this);
+ }
tray_container()->AddChildView(button_);
tray_container()->SetBorder(views::Border::NullBorder());
WmShell::Get()->system_tray_notifier()->AddLogoutButtonObserver(this);
« no previous file with comments | « no previous file | ui/views/controls/button/md_text_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698