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

Unified Diff: ash/common/wm/maximize_mode/maximize_mode_window_state.cc

Issue 2193783003: Notify WindowStateObserver when minimizing in maximized mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 5 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/BUILD.gn ('k') | ash/common/wm/window_state_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm/maximize_mode/maximize_mode_window_state.cc
diff --git a/ash/common/wm/maximize_mode/maximize_mode_window_state.cc b/ash/common/wm/maximize_mode/maximize_mode_window_state.cc
index 32805d7943d5055869d14009e295718fed37f9b5..a8aa2305a6f6b3c30736263d53693017633aab88 100644
--- a/ash/common/wm/maximize_mode/maximize_mode_window_state.cc
+++ b/ash/common/wm/maximize_mode/maximize_mode_window_state.cc
@@ -254,20 +254,9 @@ void MaximizeModeWindowState::UpdateWindow(wm::WindowState* window_state,
!window_state->CanMaximize()) ||
target_state == wm::WINDOW_STATE_TYPE_FULLSCREEN);
- if (target_state == wm::WINDOW_STATE_TYPE_MINIMIZED) {
- if (current_state_type_ == wm::WINDOW_STATE_TYPE_MINIMIZED)
- return;
-
- current_state_type_ = target_state;
- window_state->window()->SetVisibilityAnimationType(
- wm::WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE);
- window_state->window()->Hide();
- if (window_state->IsActive())
- window_state->Deactivate();
- return;
- }
-
if (current_state_type_ == target_state) {
+ if (target_state == wm::WINDOW_STATE_TYPE_MINIMIZED)
+ return;
// If the state type did not change, update it accordingly.
UpdateBounds(window_state, animated);
return;
@@ -277,7 +266,17 @@ void MaximizeModeWindowState::UpdateWindow(wm::WindowState* window_state,
current_state_type_ = target_state;
window_state->UpdateWindowShowStateFromStateType();
window_state->NotifyPreStateTypeChange(old_state_type);
- UpdateBounds(window_state, animated);
+
+ if (target_state == wm::WINDOW_STATE_TYPE_MINIMIZED) {
+ window_state->window()->SetVisibilityAnimationType(
+ wm::WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE);
+ window_state->window()->Hide();
+ if (window_state->IsActive())
+ window_state->Deactivate();
+ } else {
+ UpdateBounds(window_state, animated);
+ }
+
window_state->NotifyPostStateTypeChange(old_state_type);
if (old_state_type == wm::WINDOW_STATE_TYPE_PINNED ||
« no previous file with comments | « ash/BUILD.gn ('k') | ash/common/wm/window_state_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698