OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/user_card_view.h" | 5 #include "ash/common/system/user/user_card_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 const base::char16 kDisplayNameMark[] = {0x2060, 0}; | 58 const base::char16 kDisplayNameMark[] = {0x2060, 0}; |
59 | 59 |
60 views::View* CreateUserAvatarView(LoginStatus login_status, int user_index) { | 60 views::View* CreateUserAvatarView(LoginStatus login_status, int user_index) { |
61 RoundedImageView* image_view = new RoundedImageView(kTrayItemSize / 2); | 61 RoundedImageView* image_view = new RoundedImageView(kTrayItemSize / 2); |
62 if (login_status == LoginStatus::GUEST) { | 62 if (login_status == LoginStatus::GUEST) { |
63 gfx::ImageSkia icon = | 63 gfx::ImageSkia icon = |
64 gfx::CreateVectorIcon(kSystemMenuGuestIcon, kMenuIconColor); | 64 gfx::CreateVectorIcon(kSystemMenuGuestIcon, kMenuIconColor); |
65 image_view->SetImage(icon, icon.size()); | 65 image_view->SetImage(icon, icon.size()); |
66 } else { | 66 } else { |
67 SessionController* controller = Shell::Get()->session_controller(); | 67 SessionController* controller = Shell::Get()->session_controller(); |
68 // TODO(xiyuan); HiDpi avatar support. http://crbug.com/702689 | 68 image_view->SetImage(controller->GetUserSession(user_index)->avatar, |
69 image_view->SetImage(gfx::ImageSkia::CreateFrom1xBitmap( | |
70 controller->GetUserSession(user_index)->avatar), | |
71 gfx::Size(kTrayItemSize, kTrayItemSize)); | 69 gfx::Size(kTrayItemSize, kTrayItemSize)); |
72 } | 70 } |
73 | 71 |
74 image_view->SetBorder(views::CreateEmptyBorder(gfx::Insets( | 72 image_view->SetBorder(views::CreateEmptyBorder(gfx::Insets( |
75 (kTrayPopupItemMinStartWidth - image_view->GetPreferredSize().width()) / | 73 (kTrayPopupItemMinStartWidth - image_view->GetPreferredSize().width()) / |
76 2))); | 74 2))); |
77 return image_view; | 75 return image_view; |
78 } | 76 } |
79 | 77 |
80 // The user details shown in public account mode. This is essentially a label | 78 // The user details shown in public account mode. This is essentially a label |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 | 461 |
464 media_capture_icon_->set_id(VIEW_ID_USER_VIEW_MEDIA_INDICATOR); | 462 media_capture_icon_->set_id(VIEW_ID_USER_VIEW_MEDIA_INDICATOR); |
465 AddChildView(media_capture_icon_); | 463 AddChildView(media_capture_icon_); |
466 | 464 |
467 Shell::Get()->media_controller()->RequestCaptureState(); | 465 Shell::Get()->media_controller()->RequestCaptureState(); |
468 } | 466 } |
469 } | 467 } |
470 | 468 |
471 } // namespace tray | 469 } // namespace tray |
472 } // namespace ash | 470 } // namespace ash |
OLD | NEW |