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

Unified Diff: ash/wm/maximize_mode/maximize_mode_window_manager.cc

Issue 2887103002: Revert of Refactor backdrop (Closed)
Patch Set: Created 3 years, 7 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/wm/maximize_mode/maximize_mode_window_manager.cc
diff --git a/ash/wm/maximize_mode/maximize_mode_window_manager.cc b/ash/wm/maximize_mode/maximize_mode_window_manager.cc
index 8e7df2659d2a03b59bbce927689d3372140a931f..05b9c74c0bb0df12ad8489461996938269bd5ee4 100644
--- a/ash/wm/maximize_mode/maximize_mode_window_manager.cc
+++ b/ash/wm/maximize_mode/maximize_mode_window_manager.cc
@@ -10,9 +10,9 @@
#include "ash/session/session_state_delegate.h"
#include "ash/shell.h"
#include "ash/shell_port.h"
-#include "ash/wm/maximize_mode/maximize_mode_backdrop_delegate_impl.h"
#include "ash/wm/maximize_mode/maximize_mode_event_handler.h"
#include "ash/wm/maximize_mode/maximize_mode_window_state.h"
+#include "ash/wm/maximize_mode/workspace_backdrop_delegate.h"
#include "ash/wm/mru_window_tracker.h"
#include "ash/wm/overview/window_selector_controller.h"
#include "ash/wm/window_state.h"
@@ -82,10 +82,20 @@
}
void MaximizeModeWindowManager::OnOverviewModeStarting() {
+ if (backdrops_hidden_)
+ return;
+
+ EnableBackdropBehindTopWindowOnEachDisplay(false);
SetDeferBoundsUpdates(true);
+ backdrops_hidden_ = true;
}
void MaximizeModeWindowManager::OnOverviewModeEnded() {
+ if (!backdrops_hidden_)
+ return;
+
+ backdrops_hidden_ = false;
+ EnableBackdropBehindTopWindowOnEachDisplay(true);
SetDeferBoundsUpdates(false);
}
@@ -192,7 +202,8 @@
}
}
-MaximizeModeWindowManager::MaximizeModeWindowManager() {
+MaximizeModeWindowManager::MaximizeModeWindowManager()
+ : backdrops_hidden_(false) {
// The overview mode needs to be ended before the maximize mode is started. To
// guarantee the proper order, it will be turned off from here.
CancelOverview();
@@ -299,12 +310,17 @@
void MaximizeModeWindowManager::EnableBackdropBehindTopWindowOnEachDisplay(
bool enable) {
+ if (backdrops_hidden_)
+ return;
+
// Inform the WorkspaceLayoutManager that we want to show a backdrop behind
// the topmost window of its container.
for (WmWindow* root : ShellPort::Get()->GetAllRootWindows()) {
RootWindowController* controller = root->GetRootWindowController();
- controller->workspace_controller()->SetBackdropDelegate(
- enable ? base::MakeUnique<MaximizeModeBackdropDelegateImpl>()
+ WmWindow* default_container =
+ root->GetChildByShellWindowId(kShellWindowId_DefaultContainer);
+ controller->workspace_controller()->SetMaximizeBackdropDelegate(
+ enable ? base::MakeUnique<WorkspaceBackdropDelegate>(default_container)
: nullptr);
}
}
« no previous file with comments | « ash/wm/maximize_mode/maximize_mode_window_manager.h ('k') | ash/wm/maximize_mode/workspace_backdrop_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698