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

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

Issue 14507003: Add tray warning for Locally managed users. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes Created 7 years, 7 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
OLDNEW
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 <algorithm> 7 #include <algorithm>
8 #include <climits> 8 #include <climits>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 546
547 ash::SystemTrayDelegate* delegate = 547 ash::SystemTrayDelegate* delegate =
548 ash::Shell::GetInstance()->system_tray_delegate(); 548 ash::Shell::GetInstance()->system_tray_delegate();
549 views::View* details = new views::View; 549 views::View* details = new views::View;
550 details->SetLayoutManager(new views::BoxLayout( 550 details->SetLayoutManager(new views::BoxLayout(
551 views::BoxLayout::kVertical, 0, kUserDetailsVerticalPadding, 0)); 551 views::BoxLayout::kVertical, 0, kUserDetailsVerticalPadding, 0));
552 views::Label* username = new views::Label(delegate->GetUserDisplayName()); 552 views::Label* username = new views::Label(delegate->GetUserDisplayName());
553 username->SetHorizontalAlignment(gfx::ALIGN_LEFT); 553 username->SetHorizontalAlignment(gfx::ALIGN_LEFT);
554 details->AddChildView(username); 554 details->AddChildView(username);
555 555
556 views::Label* email = new views::Label(UTF8ToUTF16(delegate->GetUserEmail()));
557 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); 556 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
558 email->SetFont(bundle.GetFont(ui::ResourceBundle::SmallFont)); 557
559 email->SetHorizontalAlignment(gfx::ALIGN_LEFT); 558 views::Label* additional = new views::Label();
560 email->SetEnabled(false); 559
561 details->AddChildView(email); 560 additional->SetText(login == ash::user::LOGGED_IN_LOCALLY_MANAGED ?
561 bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_LOCALLY_MANAGED_LABEL):
Daniel Erat 2013/04/29 14:34:27 nit: add a space before the ':'
Denis Kuznetsov (DE-MUC) 2013/04/30 10:29:28 Done.
562 UTF8ToUTF16(delegate->GetUserEmail()));
563
564 additional->SetFont(bundle.GetFont(ui::ResourceBundle::SmallFont));
565 additional->SetHorizontalAlignment(gfx::ALIGN_LEFT);
566 additional->SetEnabled(false);
567 details->AddChildView(additional);
562 user_card_->AddChildView(details); 568 user_card_->AddChildView(details);
563 } 569 }
564 570
565 } // namespace tray 571 } // namespace tray
566 572
567 TrayUser::TrayUser(SystemTray* system_tray) 573 TrayUser::TrayUser(SystemTray* system_tray)
568 : SystemTrayItem(system_tray), 574 : SystemTrayItem(system_tray),
569 user_(NULL), 575 user_(NULL),
570 avatar_(NULL), 576 avatar_(NULL),
571 label_(NULL) { 577 label_(NULL) {
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 // Check for null to avoid crbug.com/150944. 678 // Check for null to avoid crbug.com/150944.
673 if (avatar_) { 679 if (avatar_) {
674 avatar_->SetImage( 680 avatar_->SetImage(
675 ash::Shell::GetInstance()->system_tray_delegate()->GetUserImage(), 681 ash::Shell::GetInstance()->system_tray_delegate()->GetUserImage(),
676 gfx::Size(kUserIconSize, kUserIconSize)); 682 gfx::Size(kUserIconSize, kUserIconSize));
677 } 683 }
678 } 684 }
679 685
680 } // namespace internal 686 } // namespace internal
681 } // namespace ash 687 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698