OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |