Chromium Code Reviews| 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/system/user/tray_user.h" | 5 #include "ash/system/user/tray_user.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/system/tray/system_tray_delegate.h" | 8 #include "ash/system/tray/system_tray_delegate.h" |
| 9 #include "ash/system/tray/tray_constants.h" | 9 #include "ash/system/tray/tray_constants.h" |
| 10 #include "ash/system/tray/tray_item_view.h" | 10 #include "ash/system/tray/tray_item_view.h" |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 224 return; | 224 return; |
| 225 | 225 |
| 226 container_->SetBoundsRect(gfx::Rect(size())); | 226 container_->SetBoundsRect(gfx::Rect(size())); |
| 227 if (signout_) { | 227 if (signout_) { |
| 228 gfx::Rect signout_bounds(signout_->GetPreferredSize()); | 228 gfx::Rect signout_bounds(signout_->GetPreferredSize()); |
| 229 signout_bounds = bounds().Center(signout_bounds.size()); | 229 signout_bounds = bounds().Center(signout_bounds.size()); |
| 230 signout_bounds.set_x(width() - signout_bounds.width() - | 230 signout_bounds.set_x(width() - signout_bounds.width() - |
| 231 kTrayPopupPaddingHorizontal); | 231 kTrayPopupPaddingHorizontal); |
| 232 signout_->SetBoundsRect(signout_bounds); | 232 signout_->SetBoundsRect(signout_bounds); |
| 233 | 233 |
| 234 gfx::Rect usercard_bounds(user_info_->GetPreferredSize()); | 234 if (user_info_) { |
| 235 usercard_bounds.set_width(signout_bounds.x()); | 235 gfx::Rect usercard_bounds(user_info_->GetPreferredSize()); |
| 236 user_info_->SetBoundsRect(usercard_bounds); | 236 usercard_bounds.set_width(signout_bounds.x()); |
| 237 } else { | 237 user_info_->SetBoundsRect(usercard_bounds); |
| 238 } | |
|
sadrul
2012/05/17 17:07:32
I think what this will do is we will end up with e
Jun Mukai
2012/05/17 20:13:36
Done.
| |
| 239 } else if (user_info_) { | |
| 238 user_info_->SetBoundsRect(gfx::Rect(size())); | 240 user_info_->SetBoundsRect(gfx::Rect(size())); |
| 239 } | 241 } |
| 240 } | 242 } |
| 241 | 243 |
| 242 user::LoginStatus login_; | 244 user::LoginStatus login_; |
| 243 | 245 |
| 244 TrayPopupTextButtonContainer* container_; | 246 TrayPopupTextButtonContainer* container_; |
| 245 views::View* user_info_; | 247 views::View* user_info_; |
| 246 views::Label* username_; | 248 views::Label* username_; |
| 247 views::Label* email_; | 249 views::Label* email_; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 306 } | 308 } |
| 307 | 309 |
| 308 void TrayUser::OnUserUpdate() { | 310 void TrayUser::OnUserUpdate() { |
| 309 avatar_->SetImage( | 311 avatar_->SetImage( |
| 310 ash::Shell::GetInstance()->tray_delegate()->GetUserImage(), | 312 ash::Shell::GetInstance()->tray_delegate()->GetUserImage(), |
| 311 gfx::Size(kUserIconSize, kUserIconSize)); | 313 gfx::Size(kUserIconSize, kUserIconSize)); |
| 312 } | 314 } |
| 313 | 315 |
| 314 } // namespace internal | 316 } // namespace internal |
| 315 } // namespace ash | 317 } // namespace ash |
| OLD | NEW |