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(); | |
399 base::string16 user_email_string = | 397 base::string16 user_email_string = |
400 tray_delegate->IsUserSupervised() | 398 login_status == user::LOGGED_IN_SUPERVISED |
401 ? l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SUPERVISED_LABEL) | 399 ? l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SUPERVISED_LABEL) |
402 : base::UTF8ToUTF16( | 400 : base::UTF8ToUTF16( |
403 delegate->GetUserInfo(multiprofile_index)->GetEmail()); | 401 delegate->GetUserInfo(multiprofile_index)->GetEmail()); |
404 if (!user_email_string.empty()) { | 402 if (!user_email_string.empty()) { |
405 user_email = new views::Label(user_email_string); | 403 user_email = new views::Label(user_email_string); |
406 user_email->SetFontList( | 404 user_email->SetFontList( |
407 ui::ResourceBundle::GetSharedInstance().GetFontList( | 405 ui::ResourceBundle::GetSharedInstance().GetFontList( |
408 ui::ResourceBundle::SmallFont)); | 406 ui::ResourceBundle::SmallFont)); |
409 user_email->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 407 user_email->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
410 } | 408 } |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 content::BrowserContext* context = | 467 content::BrowserContext* context = |
470 delegate->GetBrowserContextByIndex(multiprofile_index); | 468 delegate->GetBrowserContextByIndex(multiprofile_index); |
471 icon->SetImage(delegate->GetUserInfo(context)->GetImage(), | 469 icon->SetImage(delegate->GetUserInfo(context)->GetImage(), |
472 gfx::Size(kTrayAvatarSize, kTrayAvatarSize)); | 470 gfx::Size(kTrayAvatarSize, kTrayAvatarSize)); |
473 } | 471 } |
474 return icon; | 472 return icon; |
475 } | 473 } |
476 | 474 |
477 } // namespace tray | 475 } // namespace tray |
478 } // namespace ash | 476 } // namespace ash |
OLD | NEW |