| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/logout_button/tray_logout_button.h" | 5 #include "ash/system/logout_button/tray_logout_button.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 | 8 |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/system/tray/system_tray_delegate.h" | 10 #include "ash/system/tray/system_tray_delegate.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 } | 109 } |
| 110 | 110 |
| 111 user::LoginStatus login_status_; | 111 user::LoginStatus login_status_; |
| 112 bool show_logout_button_in_tray_; | 112 bool show_logout_button_in_tray_; |
| 113 | 113 |
| 114 DISALLOW_COPY_AND_ASSIGN(LogoutButton); | 114 DISALLOW_COPY_AND_ASSIGN(LogoutButton); |
| 115 }; | 115 }; |
| 116 | 116 |
| 117 } // namespace tray | 117 } // namespace tray |
| 118 | 118 |
| 119 TrayLogoutButton::TrayLogoutButton() : logout_button_(NULL) { | 119 TrayLogoutButton::TrayLogoutButton(SystemTray* system_tray) |
| 120 : SystemTrayItem(system_tray), |
| 121 logout_button_(NULL) { |
| 120 } | 122 } |
| 121 | 123 |
| 122 views::View* TrayLogoutButton::CreateTrayView(user::LoginStatus status) { | 124 views::View* TrayLogoutButton::CreateTrayView(user::LoginStatus status) { |
| 123 CHECK(logout_button_ == NULL); | 125 CHECK(logout_button_ == NULL); |
| 124 logout_button_ = new tray::LogoutButton(status); | 126 logout_button_ = new tray::LogoutButton(status); |
| 125 return logout_button_; | 127 return logout_button_; |
| 126 } | 128 } |
| 127 | 129 |
| 128 void TrayLogoutButton::DestroyTrayView() { | 130 void TrayLogoutButton::DestroyTrayView() { |
| 129 logout_button_ = NULL; | 131 logout_button_ = NULL; |
| 130 } | 132 } |
| 131 | 133 |
| 132 void TrayLogoutButton::UpdateAfterLoginStatusChange(user::LoginStatus status) { | 134 void TrayLogoutButton::UpdateAfterLoginStatusChange(user::LoginStatus status) { |
| 133 logout_button_->OnLoginStatusChanged(status); | 135 logout_button_->OnLoginStatusChanged(status); |
| 134 } | 136 } |
| 135 | 137 |
| 136 void TrayLogoutButton::OnShowLogoutButtonInTrayChanged(bool show) { | 138 void TrayLogoutButton::OnShowLogoutButtonInTrayChanged(bool show) { |
| 137 logout_button_->OnShowLogoutButtonInTrayChanged(show); | 139 logout_button_->OnShowLogoutButtonInTrayChanged(show); |
| 138 } | 140 } |
| 139 | 141 |
| 140 } // namespace internal | 142 } // namespace internal |
| 141 } // namespace ash | 143 } // namespace ash |
| OLD | NEW |