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

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

Issue 212553005: Overview Tray Button should not be visible on login screen (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 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 4ca41668d8f050713dab76be5f83bf45806d7add..edcf6e5487cc7256205ef1d273eb95266046fa13 100644
--- a/ash/system/overview/overview_button_tray.cc
+++ b/ash/system/overview/overview_button_tray.cc
@@ -6,6 +6,7 @@
#include "ash/shelf/shelf_types.h"
#include "ash/shell.h"
+#include "ash/system/tray/system_tray_delegate.h"
#include "ash/system/tray/tray_utils.h"
#include "ash/wm/overview/window_selector_controller.h"
#include "grit/ash_resources.h"
@@ -41,7 +42,8 @@ OverviewButtonTray::OverviewButtonTray(
SetIconBorderForShelfAlignment();
tray_container()->AddChildView(icon_);
- SetVisible(Shell::GetInstance()->IsMaximizeModeWindowManagerEnabled());
+ UpdateIconVisibility(Shell::GetInstance()->
+ IsMaximizeModeWindowManagerEnabled());
Shell::GetInstance()->AddShellObserver(this);
}
@@ -50,17 +52,25 @@ OverviewButtonTray::~OverviewButtonTray() {
Shell::GetInstance()->RemoveShellObserver(this);
}
+void OverviewButtonTray::UpdateAfterLoginStatusChange(
+ user::LoginStatus status) {
+ UpdateIconVisibility(Shell::GetInstance()->
+ IsMaximizeModeWindowManagerEnabled());
+}
+
bool OverviewButtonTray::PerformAction(const ui::Event& event) {
Shell::GetInstance()->window_selector_controller()->ToggleOverview();
return true;
}
void OverviewButtonTray::OnMaximizeModeStarted() {
- SetVisible(true);
+ // TODO(flackr): once maximize mode has been refactored remove this so that
+ // UpdateIconVisibility polls Shell for the status directly
+ UpdateIconVisibility(/* maximize_mode_enabled */ true);
}
void OverviewButtonTray::OnMaximizeModeEnded() {
- SetVisible(false);
+ UpdateIconVisibility(/* maximize_mode_enabled */ false);
}
bool OverviewButtonTray::ClickedOutsideBubble() {
@@ -103,4 +113,9 @@ void OverviewButtonTray::SetIconBorderForShelfAlignment() {
}
}
+void OverviewButtonTray::UpdateIconVisibility(bool maximize_mode_enabled) {
+ SetVisible(maximize_mode_enabled &&
+ Shell::GetInstance()->window_selector_controller()->CanSelect());
+}
+
} // 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