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

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: Rework lock logic 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..3a9fff87dadb5407422e2d3e1501d6ed03df04b9 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,7 @@ OverviewButtonTray::OverviewButtonTray(
SetIconBorderForShelfAlignment();
tray_container()->AddChildView(icon_);
- SetVisible(Shell::GetInstance()->IsMaximizeModeWindowManagerEnabled());
+ SetIconVisibility(Shell::GetInstance()->IsMaximizeModeWindowManagerEnabled());
Shell::GetInstance()->AddShellObserver(this);
}
@@ -56,11 +57,11 @@ bool OverviewButtonTray::PerformAction(const ui::Event& event) {
}
void OverviewButtonTray::OnMaximizeModeStarted() {
- SetVisible(true);
+ SetIconVisibility(true);
flackr 2014/03/28 16:56:40 nit: Comment what argument is for clarity: i.e. Se
jonross 2014/03/28 19:39:01 Done.
}
void OverviewButtonTray::OnMaximizeModeEnded() {
- SetVisible(false);
+ SetIconVisibility(false);
flackr 2014/03/28 16:56:40 And here.
jonross 2014/03/28 19:39:01 Done.
}
bool OverviewButtonTray::ClickedOutsideBubble() {
@@ -103,4 +104,14 @@ void OverviewButtonTray::SetIconBorderForShelfAlignment() {
}
}
+void OverviewButtonTray::SetIconVisibility(bool maximize_mode_enabled) {
flackr 2014/03/28 16:56:40 nit: Since this doesn't just use maximize_mode_ena
jonross 2014/03/28 19:39:01 Done.
+ SetVisible(maximize_mode_enabled &&
+ Shell::GetInstance()->window_selector_controller()->CanSelect());
+}
+
+void OverviewButtonTray::UpdateAfterLoginStatusChange(
+ user::LoginStatus status) {
+ SetIconVisibility(Shell::GetInstance()->IsMaximizeModeWindowManagerEnabled());
+}
+
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698