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

Unified Diff: ash/system/overview/overview_button_tray.cc

Issue 1149833006: Stop the OverviewButton from appearing on the Add-User screen (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/overview/overview_button_tray.h ('k') | ash/system/overview/overview_button_tray_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/overview/overview_button_tray.cc
diff --git a/ash/system/overview/overview_button_tray.cc b/ash/system/overview/overview_button_tray.cc
index edd5d67dd0697dd2598133cc5289d83e7511831f..f5295b52fd04bddb003cc8c118ee915b54c82f71 100644
--- a/ash/system/overview/overview_button_tray.cc
+++ b/ash/system/overview/overview_button_tray.cc
@@ -4,6 +4,7 @@
#include "ash/system/overview/overview_button_tray.h"
+#include "ash/session/session_state_delegate.h"
#include "ash/shelf/shelf_types.h"
#include "ash/shell.h"
#include "ash/system/tray/system_tray_delegate.h"
@@ -42,10 +43,13 @@ OverviewButtonTray::OverviewButtonTray(StatusAreaWidget* status_area_widget)
tray_container()->AddChildView(icon_);
Shell::GetInstance()->AddShellObserver(this);
+ Shell::GetInstance()->session_state_delegate()->AddSessionStateObserver(this);
}
OverviewButtonTray::~OverviewButtonTray() {
Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::GetInstance()->session_state_delegate()->RemoveSessionStateObserver(
+ this);
}
void OverviewButtonTray::UpdateAfterLoginStatusChange(
@@ -62,6 +66,11 @@ bool OverviewButtonTray::PerformAction(const ui::Event& event) {
return true;
}
+void OverviewButtonTray::SessionStateChanged(
+ SessionStateDelegate::SessionState state) {
+ UpdateIconVisibility();
+}
+
void OverviewButtonTray::OnMaximizeModeStarted() {
UpdateIconVisibility();
}
@@ -115,9 +124,22 @@ void OverviewButtonTray::SetIconBorderForShelfAlignment() {
}
void OverviewButtonTray::UpdateIconVisibility() {
- SetVisible(Shell::GetInstance()->maximize_mode_controller()->
- IsMaximizeModeWindowManagerEnabled() &&
- Shell::GetInstance()->window_selector_controller()->CanSelect());
+ // The visibility of the OverviewButtonTray has diverge from
+ // WindowSelectorController::CanSelect. The visibility of the button should
+ // not change during transient times in which CanSelect is false. Such as when
+ // a modal dialog is present.
+ Shell* shell = Shell::GetInstance();
+ SessionStateDelegate* session_state_delegate =
+ shell->session_state_delegate();
+
+ SetVisible(
+ shell->maximize_mode_controller()->IsMaximizeModeWindowManagerEnabled() &&
+ session_state_delegate->IsActiveUserSessionStarted() &&
+ !session_state_delegate->IsScreenLocked() &&
+ session_state_delegate->GetSessionState() ==
+ SessionStateDelegate::SESSION_STATE_ACTIVE &&
sadrul 2015/06/03 19:08:36 This ... is a bit complex. Can this be made better
jonross 2015/06/04 17:38:22 The "Active Session" term has become a bit overloa
jonross 2015/06/04 17:55:54 Filed crbug.com/496761 to cover a refactor of Sess
+ shell->system_tray_delegate()->GetUserLoginStatus() !=
+ user::LOGGED_IN_KIOSK_APP);
}
} // namespace ash
« no previous file with comments | « ash/system/overview/overview_button_tray.h ('k') | ash/system/overview/overview_button_tray_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698