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/user/tray_user.h" | 5 #include "ash/system/user/tray_user.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/system/tray/system_tray_delegate.h" | 8 #include "ash/system/tray/system_tray_delegate.h" |
9 #include "ash/system/tray/tray_constants.h" | 9 #include "ash/system/tray/tray_constants.h" |
10 #include "ash/system/tray/tray_item_view.h" | 10 #include "ash/system/tray/tray_item_view.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 // A user should not be able to modify logged in state when screen is | 122 // A user should not be able to modify logged in state when screen is |
123 // locked. | 123 // locked. |
124 if (!locked) | 124 if (!locked) |
125 AddButtonContainer(); | 125 AddButtonContainer(); |
126 } | 126 } |
127 | 127 |
128 virtual ~UserView() {} | 128 virtual ~UserView() {} |
129 | 129 |
130 // Create container for buttons. | 130 // Create container for buttons. |
131 void AddButtonContainer() { | 131 void AddButtonContainer() { |
132 TrayPopupLabelButton* button = new TrayPopupLabelButton(this, | 132 const string16 title = ash::user::GetLocalizedSignOutStringForStatus(login_, |
133 ash::user::GetLocalizedSignOutStringForStatus(login_, true)); | 133 true); |
| 134 TrayPopupLabelButton* button = new TrayPopupLabelButton(this, title); |
| 135 button->SetAccessibleName(title); |
134 AddChildView(button); | 136 AddChildView(button); |
135 signout_ = button; | 137 signout_ = button; |
136 } | 138 } |
137 | 139 |
138 private: | 140 private: |
139 void AddUserInfo() { | 141 void AddUserInfo() { |
140 user_info_ = new views::View; | 142 user_info_ = new views::View; |
141 user_info_->SetLayoutManager(new views::BoxLayout( | 143 user_info_->SetLayoutManager(new views::BoxLayout( |
142 views::BoxLayout::kHorizontal, kTrayPopupPaddingHorizontal, | 144 views::BoxLayout::kHorizontal, kTrayPopupPaddingHorizontal, |
143 kUserInfoVerticalPadding, kTrayPopupPaddingBetweenItems)); | 145 kUserInfoVerticalPadding, kTrayPopupPaddingBetweenItems)); |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 // Check for null to avoid crbug.com/150944. | 343 // Check for null to avoid crbug.com/150944. |
342 if (avatar_) { | 344 if (avatar_) { |
343 avatar_->SetImage( | 345 avatar_->SetImage( |
344 ash::Shell::GetInstance()->tray_delegate()->GetUserImage(), | 346 ash::Shell::GetInstance()->tray_delegate()->GetUserImage(), |
345 gfx::Size(kUserIconSize, kUserIconSize)); | 347 gfx::Size(kUserIconSize, kUserIconSize)); |
346 } | 348 } |
347 } | 349 } |
348 | 350 |
349 } // namespace internal | 351 } // namespace internal |
350 } // namespace ash | 352 } // namespace ash |
OLD | NEW |