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

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

Issue 308683002: Move MaximizeModeWindowManager to the controller (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 6 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 b18ee1ae1c7c89e19a360ddc94ad0864b4fa8d25..a81edc35935bfc28e390516bb9d3f1b2be2aa070 100644
--- a/ash/system/overview/overview_button_tray.cc
+++ b/ash/system/overview/overview_button_tray.cc
@@ -8,6 +8,7 @@
#include "ash/shell.h"
#include "ash/system/tray/system_tray_delegate.h"
#include "ash/system/tray/tray_utils.h"
+#include "ash/wm/maximize_mode/maximize_mode_controller.h"
#include "ash/wm/overview/window_selector_controller.h"
#include "grit/ash_resources.h"
#include "grit/ash_strings.h"
@@ -39,9 +40,7 @@ OverviewButtonTray::OverviewButtonTray(StatusAreaWidget* status_area_widget)
bundle.GetImageNamed(IDR_AURA_UBER_TRAY_OVERVIEW_MODE).ToImageSkia());
SetIconBorderForShelfAlignment();
tray_container()->AddChildView(icon_);
-
- UpdateIconVisibility(Shell::GetInstance()->
- IsMaximizeModeWindowManagerEnabled());
+ UpdateIconVisibility();
Shell::GetInstance()->AddShellObserver(this);
}
@@ -52,8 +51,7 @@ OverviewButtonTray::~OverviewButtonTray() {
void OverviewButtonTray::UpdateAfterLoginStatusChange(
user::LoginStatus status) {
- UpdateIconVisibility(Shell::GetInstance()->
- IsMaximizeModeWindowManagerEnabled());
+ UpdateIconVisibility();
}
bool OverviewButtonTray::PerformAction(const ui::Event& event) {
@@ -62,13 +60,11 @@ bool OverviewButtonTray::PerformAction(const ui::Event& event) {
}
void OverviewButtonTray::OnMaximizeModeStarted() {
- // TODO(flackr): once maximize mode has been refactored remove this so that
- // UpdateIconVisibility polls Shell for the status directly
- UpdateIconVisibility(/* maximize_mode_enabled */ true);
+ UpdateIconVisibility();
}
void OverviewButtonTray::OnMaximizeModeEnded() {
- UpdateIconVisibility(/* maximize_mode_enabled */ false);
+ UpdateIconVisibility();
}
bool OverviewButtonTray::ClickedOutsideBubble() {
@@ -111,8 +107,9 @@ void OverviewButtonTray::SetIconBorderForShelfAlignment() {
}
}
-void OverviewButtonTray::UpdateIconVisibility(bool maximize_mode_enabled) {
- SetVisible(maximize_mode_enabled &&
+void OverviewButtonTray::UpdateIconVisibility() {
+ SetVisible(Shell::GetInstance()->maximize_mode_controller()->
+ IsMaximizeModeWindowManagerEnabled() &&
Shell::GetInstance()->window_selector_controller()->CanSelect());
}
« 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