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

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..916ee231790751f565daa7a4ec1f95d7af6c5df2 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());
+ SetVisible(false);
flackr 2014/03/26 21:00:12 Won't this fail when a display is added while in m
Shell::GetInstance()->AddShellObserver(this);
}
@@ -56,7 +57,8 @@ bool OverviewButtonTray::PerformAction(const ui::Event& event) {
}
void OverviewButtonTray::OnMaximizeModeStarted() {
- SetVisible(true);
+ SetVisible(ShouldBeVisibleForLoginStatus(Shell::GetInstance()->
+ system_tray_delegate()->GetUserLoginStatus()));
}
void OverviewButtonTray::OnMaximizeModeEnded() {
@@ -103,4 +105,19 @@ void OverviewButtonTray::SetIconBorderForShelfAlignment() {
}
}
+void OverviewButtonTray::UpdateAfterLoginStatusChange(
+ user::LoginStatus status) {
+ SetVisible(Shell::GetInstance()->IsMaximizeModeWindowManagerEnabled() &&
+ ShouldBeVisibleForLoginStatus(status));
flackr 2014/03/26 21:00:12 Try to avoid repeating logic like this, it makes i
jonross 2014/03/28 16:47:04 Done.
+}
+
+bool OverviewButtonTray::ShouldBeVisibleForLoginStatus(
+ user::LoginStatus status) {
+ return status == user::LOGGED_IN_USER ||
+ status == user::LOGGED_IN_OWNER ||
+ status == user::LOGGED_IN_GUEST ||
+ status == user::LOGGED_IN_PUBLIC ||
+ status == user::LOGGED_IN_LOCALLY_MANAGED;
flackr 2014/03/26 21:00:12 Can you try to unify this with https://code.google
jonross 2014/03/28 16:47:04 Done.
+}
+
} // 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