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/user/user_card_view.h" | 5 #include "ash/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/session/session_state_delegate.h" | 10 #include "ash/session/session_state_delegate.h" |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 delegate->GetUserInfo(multiprofile_index)->GetEmail()); | 387 delegate->GetUserInfo(multiprofile_index)->GetEmail()); |
388 if (!user_name_string.empty()) { | 388 if (!user_name_string.empty()) { |
389 user_name = new views::Label(user_name_string); | 389 user_name = new views::Label(user_name_string); |
390 user_name->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 390 user_name->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
391 } | 391 } |
392 } | 392 } |
393 | 393 |
394 views::Label* user_email = NULL; | 394 views::Label* user_email = NULL; |
395 if (login_status != user::LOGGED_IN_GUEST && | 395 if (login_status != user::LOGGED_IN_GUEST && |
396 (multiprofile_index || !IsMultiAccountSupportedAndUserActive())) { | 396 (multiprofile_index || !IsMultiAccountSupportedAndUserActive())) { |
| 397 SystemTrayDelegate* tray_delegate = |
| 398 Shell::GetInstance()->system_tray_delegate(); |
397 base::string16 user_email_string = | 399 base::string16 user_email_string = |
398 login_status == user::LOGGED_IN_SUPERVISED | 400 tray_delegate->IsUserSupervised() |
399 ? l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SUPERVISED_LABEL) | 401 ? l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SUPERVISED_LABEL) |
400 : base::UTF8ToUTF16( | 402 : base::UTF8ToUTF16( |
401 delegate->GetUserInfo(multiprofile_index)->GetEmail()); | 403 delegate->GetUserInfo(multiprofile_index)->GetEmail()); |
402 if (!user_email_string.empty()) { | 404 if (!user_email_string.empty()) { |
403 user_email = new views::Label(user_email_string); | 405 user_email = new views::Label(user_email_string); |
404 user_email->SetFontList( | 406 user_email->SetFontList( |
405 ui::ResourceBundle::GetSharedInstance().GetFontList( | 407 ui::ResourceBundle::GetSharedInstance().GetFontList( |
406 ui::ResourceBundle::SmallFont)); | 408 ui::ResourceBundle::SmallFont)); |
407 user_email->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 409 user_email->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
408 } | 410 } |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 content::BrowserContext* context = | 469 content::BrowserContext* context = |
468 delegate->GetBrowserContextByIndex(multiprofile_index); | 470 delegate->GetBrowserContextByIndex(multiprofile_index); |
469 icon->SetImage(delegate->GetUserInfo(context)->GetImage(), | 471 icon->SetImage(delegate->GetUserInfo(context)->GetImage(), |
470 gfx::Size(kTrayAvatarSize, kTrayAvatarSize)); | 472 gfx::Size(kTrayAvatarSize, kTrayAvatarSize)); |
471 } | 473 } |
472 return icon; | 474 return icon; |
473 } | 475 } |
474 | 476 |
475 } // namespace tray | 477 } // namespace tray |
476 } // namespace ash | 478 } // namespace ash |
OLD | NEW |