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

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

Issue 2639203007: Update SetPaintToLayer to accept LayerType (Closed)
Patch Set: fix comments Created 3 years, 11 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/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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
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()) { 160 if (MaterialDesignController::IsShelfMaterial()) {
161 avatar_->SetPaintToLayer(true); 161 avatar_->SetPaintToLayer();
162 avatar_->layer()->SetFillsBoundsOpaquely(false); 162 avatar_->layer()->SetFillsBoundsOpaquely(false);
163 } 163 }
164 layout_view_->AddChildView(avatar_); 164 layout_view_->AddChildView(avatar_);
165 } else { 165 } else {
166 avatar_ = nullptr; 166 avatar_ = nullptr;
167 } 167 }
168 } 168 }
169 169
170 if (delegate->IsUserSupervised()) { 170 if (delegate->IsUserSupervised()) {
171 label_->SetText( 171 label_->SetText(
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 // Unit tests might come here with no images for some users. 256 // Unit tests might come here with no images for some users.
257 if (avatar_->size().IsEmpty()) 257 if (avatar_->size().IsEmpty())
258 avatar_->SetSize(gfx::Size(kTrayItemSize, kTrayItemSize)); 258 avatar_->SetSize(gfx::Size(kTrayItemSize, kTrayItemSize));
259 } 259 }
260 260
261 void TrayUser::UpdateLayoutOfItem() { 261 void TrayUser::UpdateLayoutOfItem() {
262 UpdateAfterShelfAlignmentChange(system_tray()->shelf_alignment()); 262 UpdateAfterShelfAlignmentChange(system_tray()->shelf_alignment());
263 } 263 }
264 264
265 } // namespace ash 265 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698