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

Side by Side Diff: ash/system/chromeos/session/logout_button_tray.cc

Issue 2099103002: Give Ash material design tray items the correct size and layout (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: split shelf and tray constants 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/system/chromeos/session/logout_button_tray.h" 5 #include "ash/system/chromeos/session/logout_button_tray.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "ash/common/shelf/shelf_types.h" 10 #include "ash/common/shelf/shelf_types.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 border->SetPainter( 82 border->SetPainter(
83 false, views::Button::STATE_PRESSED, 83 false, views::Button::STATE_PRESSED,
84 views::Painter::CreateImageGridPainter(kLogoutButtonPushedImages)); 84 views::Painter::CreateImageGridPainter(kLogoutButtonPushedImages));
85 gfx::Insets insets = border->GetInsets(); 85 gfx::Insets insets = border->GetInsets();
86 insets += gfx::Insets(0, kLogoutButtonHorizontalExtraPadding, 0, 86 insets += gfx::Insets(0, kLogoutButtonHorizontalExtraPadding, 0,
87 kLogoutButtonHorizontalExtraPadding); 87 kLogoutButtonHorizontalExtraPadding);
88 border->set_insets(insets); 88 border->set_insets(insets);
89 SetBorder(std::move(border)); 89 SetBorder(std::move(border));
90 set_animate_on_state_change(false); 90 set_animate_on_state_change(false);
91 91
92 SetMinSize(gfx::Size(0, kShelfItemHeight)); 92 SetMinSize(gfx::Size(0, GetTrayConstant(TRAY_ITEM_HEIGHT_LEGACY)));
93 } 93 }
94 94
95 LogoutButton::~LogoutButton() {} 95 LogoutButton::~LogoutButton() {}
96 96
97 LogoutButtonTray::LogoutButtonTray(WmShelf* wm_shelf) 97 LogoutButtonTray::LogoutButtonTray(WmShelf* wm_shelf)
98 : TrayBackgroundView(wm_shelf), 98 : TrayBackgroundView(wm_shelf),
99 button_(NULL), 99 button_(NULL),
100 login_status_(LoginStatus::NOT_LOGGED_IN), 100 login_status_(LoginStatus::NOT_LOGGED_IN),
101 show_logout_button_in_tray_(false) { 101 show_logout_button_in_tray_(false) {
102 button_ = new LogoutButton(this); 102 button_ = new LogoutButton(this);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 UpdateVisibility(); 153 UpdateVisibility();
154 } 154 }
155 155
156 void LogoutButtonTray::UpdateVisibility() { 156 void LogoutButtonTray::UpdateVisibility() {
157 SetVisible(show_logout_button_in_tray_ && 157 SetVisible(show_logout_button_in_tray_ &&
158 login_status_ != LoginStatus::NOT_LOGGED_IN && 158 login_status_ != LoginStatus::NOT_LOGGED_IN &&
159 login_status_ != LoginStatus::LOCKED); 159 login_status_ != LoginStatus::LOCKED);
160 } 160 }
161 161
162 } // namespace ash 162 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/overflow_button.cc ('k') | ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698