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

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: Decouple Overview Visibility from WindowSelector activation 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..3385dc8884f932a1d2e8db588a6fd5dc6f829fba 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,14 +43,21 @@ 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(
user::LoginStatus status) {
+ if (status == user::LOGGED_IN_KIOSK_APP) {
+ SetVisible(false);
flackr 2015/06/01 17:05:32 What guarantee is there that the visibility won't
jonross 2015/06/01 17:20:37 Good point. Done.
+ return;
+ }
UpdateIconVisibility();
}
@@ -62,6 +70,11 @@ bool OverviewButtonTray::PerformAction(const ui::Event& event) {
return true;
}
+void OverviewButtonTray::SessionStateChanged(
+ SessionStateDelegate::SessionState state) {
+ UpdateIconVisibility();
+}
+
void OverviewButtonTray::OnMaximizeModeStarted() {
UpdateIconVisibility();
}
@@ -115,9 +128,16 @@ void OverviewButtonTray::SetIconBorderForShelfAlignment() {
}
void OverviewButtonTray::UpdateIconVisibility() {
- SetVisible(Shell::GetInstance()->maximize_mode_controller()->
- IsMaximizeModeWindowManagerEnabled() &&
- Shell::GetInstance()->window_selector_controller()->CanSelect());
+ SetVisible(
+ Shell::GetInstance()
+ ->maximize_mode_controller()
+ ->IsMaximizeModeWindowManagerEnabled() &&
+ Shell::GetInstance()
+ ->session_state_delegate()
+ ->IsActiveUserSessionStarted() &&
+ !Shell::GetInstance()->session_state_delegate()->IsScreenLocked() &&
+ Shell::GetInstance()->session_state_delegate()->GetSessionState() ==
+ SessionStateDelegate::SESSION_STATE_ACTIVE);
}
} // 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