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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 SetBorder(std::move(border)); | 88 SetBorder(std::move(border)); |
89 set_animate_on_state_change(false); | 89 set_animate_on_state_change(false); |
90 | 90 |
91 SetMinSize(gfx::Size(0, kShelfItemHeight)); | 91 SetMinSize(gfx::Size(0, kShelfItemHeight)); |
92 } | 92 } |
93 | 93 |
94 LogoutButton::~LogoutButton() { | 94 LogoutButton::~LogoutButton() { |
95 } | 95 } |
96 | 96 |
97 LogoutButtonTray::LogoutButtonTray(StatusAreaWidget* status_area_widget) | 97 LogoutButtonTray::LogoutButtonTray(StatusAreaWidget* status_area_widget) |
98 : TrayBackgroundView(status_area_widget->wm_shelf()), | 98 : TrayBackgroundView(status_area_widget), |
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); |
103 tray_container()->AddChildView(button_); | 103 tray_container()->AddChildView(button_); |
104 tray_container()->SetBorder(views::Border::NullBorder()); | 104 tray_container()->SetBorder(views::Border::NullBorder()); |
105 Shell::GetInstance()->system_tray_notifier()->AddLogoutButtonObserver(this); | 105 Shell::GetInstance()->system_tray_notifier()->AddLogoutButtonObserver(this); |
106 } | 106 } |
107 | 107 |
108 LogoutButtonTray::~LogoutButtonTray() { | 108 LogoutButtonTray::~LogoutButtonTray() { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 UpdateVisibility(); | 155 UpdateVisibility(); |
156 } | 156 } |
157 | 157 |
158 void LogoutButtonTray::UpdateVisibility() { | 158 void LogoutButtonTray::UpdateVisibility() { |
159 SetVisible(show_logout_button_in_tray_ && | 159 SetVisible(show_logout_button_in_tray_ && |
160 login_status_ != LoginStatus::NOT_LOGGED_IN && | 160 login_status_ != LoginStatus::NOT_LOGGED_IN && |
161 login_status_ != LoginStatus::LOCKED); | 161 login_status_ != LoginStatus::LOCKED); |
162 } | 162 } |
163 | 163 |
164 } // namespace ash | 164 } // namespace ash |
OLD | NEW |