| OLD | NEW |
| 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/common/system/user/tray_user.h" | 5 #include "ash/common/system/user/tray_user.h" |
| 6 | 6 |
| 7 #include "ash/common/material_design/material_design_controller.h" | 7 #include "ash/common/material_design/material_design_controller.h" |
| 8 #include "ash/common/session/session_state_delegate.h" | 8 #include "ash/common/session/session_state_delegate.h" |
| 9 #include "ash/common/shelf/wm_shelf_util.h" | 9 #include "ash/common/shelf/wm_shelf_util.h" |
| 10 #include "ash/common/system/tray/system_tray.h" | 10 #include "ash/common/system/tray/system_tray.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 150 |
| 151 if (need_label) { | 151 if (need_label) { |
| 152 label_ = new views::Label; | 152 label_ = new views::Label; |
| 153 SetupLabelForTray(label_); | 153 SetupLabelForTray(label_); |
| 154 layout_view_->AddChildView(label_); | 154 layout_view_->AddChildView(label_); |
| 155 } else { | 155 } else { |
| 156 label_ = nullptr; | 156 label_ = nullptr; |
| 157 } | 157 } |
| 158 if (need_avatar) { | 158 if (need_avatar) { |
| 159 avatar_ = new tray::RoundedImageView(kTrayRoundedBorderRadius, true); | 159 avatar_ = new tray::RoundedImageView(kTrayRoundedBorderRadius, true); |
| 160 if (MaterialDesignController::IsShelfMaterial()) { |
| 161 avatar_->SetPaintToLayer(true); |
| 162 avatar_->layer()->SetFillsBoundsOpaquely(false); |
| 163 } |
| 160 layout_view_->AddChildView(avatar_); | 164 layout_view_->AddChildView(avatar_); |
| 161 } else { | 165 } else { |
| 162 avatar_ = nullptr; | 166 avatar_ = nullptr; |
| 163 } | 167 } |
| 164 } | 168 } |
| 165 | 169 |
| 166 if (delegate->IsUserSupervised()) { | 170 if (delegate->IsUserSupervised()) { |
| 167 label_->SetText( | 171 label_->SetText( |
| 168 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SUPERVISED_LABEL)); | 172 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SUPERVISED_LABEL)); |
| 169 } else if (status == LoginStatus::GUEST) { | 173 } else if (status == LoginStatus::GUEST) { |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 // Unit tests might come here with no images for some users. | 256 // Unit tests might come here with no images for some users. |
| 253 if (avatar_->size().IsEmpty()) | 257 if (avatar_->size().IsEmpty()) |
| 254 avatar_->SetSize(gfx::Size(kTrayItemSize, kTrayItemSize)); | 258 avatar_->SetSize(gfx::Size(kTrayItemSize, kTrayItemSize)); |
| 255 } | 259 } |
| 256 | 260 |
| 257 void TrayUser::UpdateLayoutOfItem() { | 261 void TrayUser::UpdateLayoutOfItem() { |
| 258 UpdateAfterShelfAlignmentChange(system_tray()->shelf_alignment()); | 262 UpdateAfterShelfAlignmentChange(system_tray()->shelf_alignment()); |
| 259 } | 263 } |
| 260 | 264 |
| 261 } // namespace ash | 265 } // namespace ash |
| OLD | NEW |