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

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

Issue 588193003: Defer maximize mode bounds updates until after exiting overview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test WindowAnimationsTest.CrossFadeToBoundsFromTransform Created 6 years, 3 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/wm/maximize_mode/maximize_mode_window_state.h ('k') | ash/wm/overview/window_selector_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/maximize_mode/maximize_mode_window_state.cc
diff --git a/ash/wm/maximize_mode/maximize_mode_window_state.cc b/ash/wm/maximize_mode/maximize_mode_window_state.cc
index e30c4b1878a05804808da4e901fbfcb4a0913d9e..07f0c120a786ef560ae4e0b182df04d692477a81 100644
--- a/ash/wm/maximize_mode/maximize_mode_window_state.cc
+++ b/ash/wm/maximize_mode/maximize_mode_window_state.cc
@@ -20,6 +20,7 @@
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/window.h"
#include "ui/aura/window_delegate.h"
+#include "ui/compositor/layer.h"
#include "ui/gfx/display.h"
#include "ui/gfx/rect.h"
#include "ui/views/view_constants_aura.h"
@@ -98,7 +99,8 @@ MaximizeModeWindowState::MaximizeModeWindowState(
aura::Window* window, MaximizeModeWindowManager* creator)
: window_(window),
creator_(creator),
- current_state_type_(wm::GetWindowState(window)->GetStateType()) {
+ current_state_type_(wm::GetWindowState(window)->GetStateType()),
+ defer_bounds_updates_(false) {
old_state_.reset(
wm::GetWindowState(window)->SetStateObject(
scoped_ptr<State>(this).Pass()).release());
@@ -114,6 +116,15 @@ void MaximizeModeWindowState::LeaveMaximizeMode(wm::WindowState* window_state) {
window_state->SetStateObject(old_state_.Pass());
}
+void MaximizeModeWindowState::SetDeferBoundsUpdates(bool defer_bounds_updates) {
+ if (defer_bounds_updates_ == defer_bounds_updates)
+ return;
+
+ defer_bounds_updates_ = defer_bounds_updates;
+ if (!defer_bounds_updates_)
+ UpdateBounds(wm::GetWindowState(window_), true);
+}
+
void MaximizeModeWindowState::OnWMEvent(wm::WindowState* window_state,
const wm::WMEvent* event) {
switch (event->type()) {
@@ -280,6 +291,8 @@ wm::WindowStateType MaximizeModeWindowState::GetMaximizedOrCenteredWindowType(
void MaximizeModeWindowState::UpdateBounds(wm::WindowState* window_state,
bool animated) {
+ if (defer_bounds_updates_)
+ return;
gfx::Rect bounds_in_parent = GetBoundsInMaximizedMode(window_state);
// If we have a target bounds rectangle, we center it and set it
// accordingly.
« no previous file with comments | « ash/wm/maximize_mode/maximize_mode_window_state.h ('k') | ash/wm/overview/window_selector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698