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/common/system/user/user_card_view.h" | 5 #include "ash/common/system/user/user_card_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/common/login_status.h" | 10 #include "ash/common/login_status.h" |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 user_name->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 369 user_name->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
370 } | 370 } |
371 } | 371 } |
372 | 372 |
373 views::Label* user_email = NULL; | 373 views::Label* user_email = NULL; |
374 if (login_status != LoginStatus::GUEST) { | 374 if (login_status != LoginStatus::GUEST) { |
375 SystemTrayDelegate* tray_delegate = WmShell::Get()->system_tray_delegate(); | 375 SystemTrayDelegate* tray_delegate = WmShell::Get()->system_tray_delegate(); |
376 base::string16 user_email_string = | 376 base::string16 user_email_string = |
377 tray_delegate->IsUserSupervised() | 377 tray_delegate->IsUserSupervised() |
378 ? l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SUPERVISED_LABEL) | 378 ? l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SUPERVISED_LABEL) |
379 : base::UTF8ToUTF16(delegate->GetUserInfo(user_index)->GetEmail()); | 379 : base::UTF8ToUTF16( |
| 380 delegate->GetUserInfo(user_index)->GetDisplayEmail()); |
380 if (!user_email_string.empty()) { | 381 if (!user_email_string.empty()) { |
381 user_email = new views::Label(user_email_string); | 382 user_email = new views::Label(user_email_string); |
382 user_email->SetFontList( | 383 user_email->SetFontList( |
383 ui::ResourceBundle::GetSharedInstance().GetFontList( | 384 ui::ResourceBundle::GetSharedInstance().GetFontList( |
384 ui::ResourceBundle::SmallFont)); | 385 ui::ResourceBundle::SmallFont)); |
385 user_email->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 386 user_email->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
386 } | 387 } |
387 } | 388 } |
388 | 389 |
389 // Adjust text properties dependent on if it is an active or inactive user. | 390 // Adjust text properties dependent on if it is an active or inactive user. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 } else { | 443 } else { |
443 SessionStateDelegate* delegate = WmShell::Get()->GetSessionStateDelegate(); | 444 SessionStateDelegate* delegate = WmShell::Get()->GetSessionStateDelegate(); |
444 icon->SetImage(delegate->GetUserInfo(user_index)->GetImage(), | 445 icon->SetImage(delegate->GetUserInfo(user_index)->GetImage(), |
445 gfx::Size(kTrayItemSize, kTrayItemSize)); | 446 gfx::Size(kTrayItemSize, kTrayItemSize)); |
446 } | 447 } |
447 return icon; | 448 return icon; |
448 } | 449 } |
449 | 450 |
450 } // namespace tray | 451 } // namespace tray |
451 } // namespace ash | 452 } // namespace ash |
OLD | NEW |