Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: ash/system/user/user_card_view.cc

Issue 2829813002: cros: Move IsUserSupervised and IsUserChild off SystemTrayDelegate (Closed)
Patch Set: review comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/system/user/tray_user.cc ('k') | ash/test/test_session_controller_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 407
408 TrayPopupItemStyle user_email_style(TrayPopupItemStyle::FontStyle::CAPTION); 408 TrayPopupItemStyle user_email_style(TrayPopupItemStyle::FontStyle::CAPTION);
409 // Only the active user's email label is lightened (for the inactive user, the 409 // Only the active user's email label is lightened (for the inactive user, the
410 // label starts as black and the entire row is 54% opacity). 410 // label starts as black and the entire row is 54% opacity).
411 if (is_active_user()) 411 if (is_active_user())
412 user_email_style.set_color_style(TrayPopupItemStyle::ColorStyle::INACTIVE); 412 user_email_style.set_color_style(TrayPopupItemStyle::ColorStyle::INACTIVE);
413 auto* user_email = new views::Label(); 413 auto* user_email = new views::Label();
414 base::string16 user_email_string; 414 base::string16 user_email_string;
415 if (login_status != LoginStatus::GUEST) { 415 if (login_status != LoginStatus::GUEST) {
416 user_email_string = 416 user_email_string =
417 Shell::Get()->system_tray_delegate()->IsUserSupervised() 417 Shell::Get()->session_controller()->IsUserSupervised()
418 ? l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SUPERVISED_LABEL) 418 ? l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SUPERVISED_LABEL)
419 : base::UTF8ToUTF16( 419 : base::UTF8ToUTF16(
420 controller->GetUserSession(user_index_)->display_email); 420 controller->GetUserSession(user_index_)->display_email);
421 } 421 }
422 user_email->SetText(user_email_string); 422 user_email->SetText(user_email_string);
423 user_email->SetHorizontalAlignment(gfx::ALIGN_LEFT); 423 user_email->SetHorizontalAlignment(gfx::ALIGN_LEFT);
424 user_email_style.SetupLabel(user_email); 424 user_email_style.SetupLabel(user_email);
425 user_email->SetVisible(!user_email_string.empty()); 425 user_email->SetVisible(!user_email_string.empty());
426 user_email->set_collapse_when_hidden(true); 426 user_email->set_collapse_when_hidden(true);
427 427
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 460
461 media_capture_icon_->set_id(VIEW_ID_USER_VIEW_MEDIA_INDICATOR); 461 media_capture_icon_->set_id(VIEW_ID_USER_VIEW_MEDIA_INDICATOR);
462 AddChildView(media_capture_icon_); 462 AddChildView(media_capture_icon_);
463 463
464 Shell::Get()->media_controller()->RequestCaptureState(); 464 Shell::Get()->media_controller()->RequestCaptureState();
465 } 465 }
466 } 466 }
467 467
468 } // namespace tray 468 } // namespace tray
469 } // namespace ash 469 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/user/tray_user.cc ('k') | ash/test/test_session_controller_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698