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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 border->SetImages(views::CustomButton::STATE_HOVERED, | 79 border->SetImages(views::CustomButton::STATE_HOVERED, |
80 views::BorderImages(kLogoutButtonBorderHotImages)); | 80 views::BorderImages(kLogoutButtonBorderHotImages)); |
81 border->SetImages(views::CustomButton::STATE_PRESSED, | 81 border->SetImages(views::CustomButton::STATE_PRESSED, |
82 views::BorderImages(kLogoutButtonBorderPushedImages)); | 82 views::BorderImages(kLogoutButtonBorderPushedImages)); |
83 set_border(border); | 83 set_border(border); |
84 OnLoginStatusChanged(status); | 84 OnLoginStatusChanged(status); |
85 } | 85 } |
86 | 86 |
87 void OnLoginStatusChanged(user::LoginStatus status) { | 87 void OnLoginStatusChanged(user::LoginStatus status) { |
88 login_status_ = status; | 88 login_status_ = status; |
89 SetText(GetLocalizedSignOutStringForStatus(login_status_, false)); | 89 const string16 title = GetLocalizedSignOutStringForStatus(login_status_, |
| 90 false); |
| 91 SetText(title); |
| 92 SetAccessibleName(title); |
90 UpdateVisibility(); | 93 UpdateVisibility(); |
91 } | 94 } |
92 | 95 |
93 void OnShowLogoutButtonInTrayChanged(bool show) { | 96 void OnShowLogoutButtonInTrayChanged(bool show) { |
94 show_logout_button_in_tray_ = show; | 97 show_logout_button_in_tray_ = show; |
95 UpdateVisibility(); | 98 UpdateVisibility(); |
96 } | 99 } |
97 | 100 |
98 // Overridden from views::ButtonListener. | 101 // Overridden from views::ButtonListener. |
99 void ButtonPressed(views::Button* sender, const ui::Event& event) OVERRIDE { | 102 void ButtonPressed(views::Button* sender, const ui::Event& event) OVERRIDE { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 void TrayLogoutButton::UpdateAfterLoginStatusChange(user::LoginStatus status) { | 137 void TrayLogoutButton::UpdateAfterLoginStatusChange(user::LoginStatus status) { |
135 logout_button_->OnLoginStatusChanged(status); | 138 logout_button_->OnLoginStatusChanged(status); |
136 } | 139 } |
137 | 140 |
138 void TrayLogoutButton::OnShowLogoutButtonInTrayChanged(bool show) { | 141 void TrayLogoutButton::OnShowLogoutButtonInTrayChanged(bool show) { |
139 logout_button_->OnShowLogoutButtonInTrayChanged(show); | 142 logout_button_->OnShowLogoutButtonInTrayChanged(show); |
140 } | 143 } |
141 | 144 |
142 } // namespace internal | 145 } // namespace internal |
143 } // namespace ash | 146 } // namespace ash |
OLD | NEW |