Chromium Code Reviews| Index: ash/common/system/user/tray_user.h |
| diff --git a/ash/common/system/user/tray_user.h b/ash/common/system/user/tray_user.h |
| index 2b3573d7f0c237d8bd7cf830516bc2edb677e3fe..931618e36ea4c8130e411e181df47eb9c9a67060 100644 |
| --- a/ash/common/system/user/tray_user.h |
| +++ b/ash/common/system/user/tray_user.h |
| @@ -6,8 +6,8 @@ |
| #define ASH_COMMON_SYSTEM_USER_TRAY_USER_H_ |
| #include "ash/ash_export.h" |
| +#include "ash/common/session/session_state_observer.h" |
| #include "ash/common/system/tray/system_tray_item.h" |
| -#include "ash/common/system/user/user_observer.h" |
| #include "ash/public/cpp/session_types.h" |
| #include "base/macros.h" |
| @@ -27,7 +27,7 @@ class RoundedImageView; |
| class UserView; |
| } |
| -class ASH_EXPORT TrayUser : public SystemTrayItem, public UserObserver { |
| +class ASH_EXPORT TrayUser : public SystemTrayItem, public SessionStateObserver { |
| public: |
| // The given |index| is the user index in a multi profile scenario. Index #0 |
| // is the active user, the other indices are other logged in users (if there |
| @@ -68,24 +68,27 @@ class ASH_EXPORT TrayUser : public SystemTrayItem, public UserObserver { |
| void UpdateAfterLoginStatusChange(LoginStatus status) override; |
| void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) override; |
| - // Overridden from UserObserver. |
| - void OnUserUpdate() override; |
| - void OnUserAddedToSession() override; |
| + // Overridden from SessionStateObserver. |
| + void ActiveUserChanged(const AccountId& account_id) override; |
| + void UserAddedToSession(const AccountId& account_id) override; |
| + void UserSessionUpdated(const AccountId& account_id) override; |
| void UpdateAvatarImage(LoginStatus status); |
| // Updates the layout of this item. |
| void UpdateLayoutOfItem(); |
| + ScopedSessionStateObserver scoped_session_observer_; |
| + |
| // The user index to use. |
| - UserIndex user_index_; |
| + const UserIndex user_index_; |
|
James Cook
2017/03/29 00:51:23
Hooray for const!
|
| - tray::UserView* user_; |
| + tray::UserView* user_ = nullptr; |
| // View that contains label and/or avatar. |
| - views::View* layout_view_; |
| - tray::RoundedImageView* avatar_; |
| - views::Label* label_; |
| + views::View* layout_view_ = nullptr; |
| + tray::RoundedImageView* avatar_ = nullptr; |
| + views::Label* label_ = nullptr; |
| DISALLOW_COPY_AND_ASSIGN(TrayUser); |
| }; |