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

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
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..010f9d305c2d5f28111926f50e4ac5e09bfc412a 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);
}
@@ -56,11 +58,11 @@ bool OverviewButtonTray::PerformAction(const ui::Event& event) {
}
void OverviewButtonTray::OnMaximizeModeStarted() {
- SetVisible(true);
+ UpdateIconVisibility(/* maximize_mode_enabled */ true);
sadrul 2014/03/28 21:23:35 In some parts of the code, an enum is used instead
jonross 2014/03/31 15:09:01 This is only here until a refactor of MaximizeMode
}
void OverviewButtonTray::OnMaximizeModeEnded() {
- SetVisible(false);
+ UpdateIconVisibility(/* maximize_mode_enabled */ false);
}
bool OverviewButtonTray::ClickedOutsideBubble() {
@@ -103,4 +105,15 @@ void OverviewButtonTray::SetIconBorderForShelfAlignment() {
}
}
+void OverviewButtonTray::UpdateIconVisibility(bool maximize_mode_enabled) {
+ SetVisible(maximize_mode_enabled &&
+ Shell::GetInstance()->window_selector_controller()->CanSelect());
+}
+
+void OverviewButtonTray::UpdateAfterLoginStatusChange(
+ user::LoginStatus status) {
+ UpdateIconVisibility(Shell::GetInstance()->
+ IsMaximizeModeWindowManagerEnabled());
+}
sadrul 2014/03/28 21:23:35 The function order in .cc should match the order i
jonross 2014/03/31 15:09:01 Done.
+
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698