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 <algorithm> | 7 #include <algorithm> |
8 #include <climits> | 8 #include <climits> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 | 480 |
481 const string16 title = ash::user::GetLocalizedSignOutStringForStatus(login, | 481 const string16 title = ash::user::GetLocalizedSignOutStringForStatus(login, |
482 true); | 482 true); |
483 TrayPopupLabelButton* logout_button = new TrayPopupLabelButton(this, title); | 483 TrayPopupLabelButton* logout_button = new TrayPopupLabelButton(this, title); |
484 logout_button->SetAccessibleName(title); | 484 logout_button->SetAccessibleName(title); |
485 logout_button_ = logout_button; | 485 logout_button_ = logout_button; |
486 // In public account mode, the logout button border has a custom color. | 486 // In public account mode, the logout button border has a custom color. |
487 if (login == ash::user::LOGGED_IN_PUBLIC) { | 487 if (login == ash::user::LOGGED_IN_PUBLIC) { |
488 TrayPopupLabelButtonBorder* border = | 488 TrayPopupLabelButtonBorder* border = |
489 static_cast<TrayPopupLabelButtonBorder*>(logout_button_->border()); | 489 static_cast<TrayPopupLabelButtonBorder*>(logout_button_->border()); |
490 border->SetPainter(views::CustomButton::STATE_NORMAL, | 490 border->SetPainter(views::Button::STATE_NORMAL, |
491 views::Painter::CreateImageGridPainter( | 491 views::Painter::CreateImageGridPainter( |
492 kPublicAccountLogoutButtonBorderImagesNormal)); | 492 kPublicAccountLogoutButtonBorderImagesNormal)); |
493 border->SetPainter(views::CustomButton::STATE_HOVERED, | 493 border->SetPainter(views::Button::STATE_HOVERED, |
494 views::Painter::CreateImageGridPainter( | 494 views::Painter::CreateImageGridPainter( |
495 kPublicAccountLogoutButtonBorderImagesHovered)); | 495 kPublicAccountLogoutButtonBorderImagesHovered)); |
496 border->SetPainter(views::CustomButton::STATE_PRESSED, | 496 border->SetPainter(views::Button::STATE_PRESSED, |
497 views::Painter::CreateImageGridPainter( | 497 views::Painter::CreateImageGridPainter( |
498 kPublicAccountLogoutButtonBorderImagesHovered)); | 498 kPublicAccountLogoutButtonBorderImagesHovered)); |
499 } | 499 } |
500 AddChildView(logout_button_); | 500 AddChildView(logout_button_); |
501 } | 501 } |
502 | 502 |
503 void UserView::AddUserCard(SystemTrayItem* owner, | 503 void UserView::AddUserCard(SystemTrayItem* owner, |
504 ash::user::LoginStatus login) { | 504 ash::user::LoginStatus login) { |
505 if (login == ash::user::LOGGED_IN_GUEST) | 505 if (login == ash::user::LOGGED_IN_GUEST) |
506 return; | 506 return; |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 // Check for null to avoid crbug.com/150944. | 660 // Check for null to avoid crbug.com/150944. |
661 if (avatar_) { | 661 if (avatar_) { |
662 avatar_->SetImage( | 662 avatar_->SetImage( |
663 ash::Shell::GetInstance()->system_tray_delegate()->GetUserImage(), | 663 ash::Shell::GetInstance()->system_tray_delegate()->GetUserImage(), |
664 gfx::Size(kUserIconSize, kUserIconSize)); | 664 gfx::Size(kUserIconSize, kUserIconSize)); |
665 } | 665 } |
666 } | 666 } |
667 | 667 |
668 } // namespace internal | 668 } // namespace internal |
669 } // namespace ash | 669 } // namespace ash |
OLD | NEW |