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

Unified Diff: ash/system/user/tray_user.cc

Issue 15718003: Add SessionStateObserver with ActiveUserChanged() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: close button when switching users, notify observers with ActiveUserChanged() when new user logs in Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: ash/system/user/tray_user.cc
diff --git a/ash/system/user/tray_user.cc b/ash/system/user/tray_user.cc
index e3c0697a9c4321d3f3b116f9831efed0de9c008f..3da03a99f83522f7209884afefb884e3ad3a1fe8 100644
--- a/ash/system/user/tray_user.cc
+++ b/ash/system/user/tray_user.cc
@@ -273,6 +273,9 @@ class UserView : public views::View,
// The view of the user card.
views::View* user_card_view_;
+ // This is the owner system tray item of this view.
+ SystemTrayItem* owner_;
+
// True if |user_card_view_| is a |UserView| - otherwise it is only a
// |views::View|.
bool is_user_card_;
@@ -595,6 +598,7 @@ UserView::UserView(SystemTrayItem* owner,
MultiProfileIndex index)
: multiprofile_index_(index),
user_card_view_(NULL),
+ owner_(owner),
Mr4D (OOO till 08-26) 2013/05/31 22:23:39 Instead of passing the owner you might consider to
bartfab (slow) 2013/06/03 09:00:06 |owner_| will continue to work if/when we have mul
Nikita (slow) 2013/06/03 09:21:28 Leaving as is then to follow existing pattern and
is_user_card_(false),
logout_button_(NULL),
add_user_visible_but_disabled_(false) {
@@ -710,6 +714,8 @@ void UserView::ButtonPressed(views::Button* sender, const ui::Event& event) {
ash::SessionStateDelegate* delegate =
ash::Shell::GetInstance()->session_state_delegate();
delegate->SwitchActiveUser(delegate->GetUserEmail(multiprofile_index_));
+ // User list will change and it makes sense to close bubble.
Mr4D (OOO till 08-26) 2013/05/31 22:23:39 Since the user list is about to change the system
Nikita (slow) 2013/06/03 09:21:28 Done.
+ owner_->system_tray()->CloseSystemBubble();
}
} else if (add_menu_option_.get() &&
sender == add_menu_option_->GetContentsView()) {

Powered by Google App Engine
This is Rietveld 408576698