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

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: merge & reviews 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
« no previous file with comments | « ash/system/tray/system_tray_unittest.cc ('k') | ash/system/user/tray_user_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2b7dc563f978e0d8cdb1126bbd3881eca213413b 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),
is_user_card_(false),
logout_button_(NULL),
add_user_visible_but_disabled_(false) {
@@ -710,6 +714,9 @@ 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_));
+ // Since the user list is about to change
bartfab (slow) 2013/06/03 09:26:52 Nit: Any particular reason for breaking the line h
Nikita (slow) 2013/06/03 09:46:54 Done.
+ // the system menu should get closed.
+ owner_->system_tray()->CloseSystemBubble();
}
} else if (add_menu_option_.get() &&
sender == add_menu_option_->GetContentsView()) {
« no previous file with comments | « ash/system/tray/system_tray_unittest.cc ('k') | ash/system/user/tray_user_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698