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

Side by Side Diff: ash/wm/maximize_mode/maximize_mode_window_state.cc

Issue 1901773002: Removes most of aura dependencies from DefaultState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wm_window_positioner
Patch Set: nit and merge Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « ash/wm/lock_window_state.cc ('k') | ash/wm/panels/panel_layout_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/maximize_mode/maximize_mode_window_state.h" 5 #include "ash/wm/maximize_mode/maximize_mode_window_state.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/screen_util.h" 9 #include "ash/screen_util.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
11 #include "ash/shell_window_ids.h" 11 #include "ash/shell_window_ids.h"
12 #include "ash/wm/common/window_animation_types.h"
13 #include "ash/wm/common/window_state_util.h"
12 #include "ash/wm/common/wm_event.h" 14 #include "ash/wm/common/wm_event.h"
13 #include "ash/wm/coordinate_conversion.h" 15 #include "ash/wm/coordinate_conversion.h"
14 #include "ash/wm/maximize_mode/maximize_mode_window_manager.h" 16 #include "ash/wm/maximize_mode/maximize_mode_window_manager.h"
15 #include "ash/wm/window_animations.h" 17 #include "ash/wm/window_animations.h"
16 #include "ash/wm/window_properties.h" 18 #include "ash/wm/window_properties.h"
17 #include "ash/wm/window_state_aura.h" 19 #include "ash/wm/window_state_aura.h"
18 #include "ash/wm/window_state_delegate.h" 20 #include "ash/wm/window_state_delegate.h"
19 #include "ash/wm/window_state_util.h"
20 #include "ash/wm/window_util.h" 21 #include "ash/wm/window_util.h"
21 #include "ash/wm/workspace/workspace_window_resizer.h" 22 #include "ash/wm/workspace/workspace_window_resizer.h"
22 #include "ui/aura/client/aura_constants.h" 23 #include "ui/aura/client/aura_constants.h"
23 #include "ui/aura/window.h" 24 #include "ui/aura/window.h"
24 #include "ui/aura/window_delegate.h" 25 #include "ui/aura/window_delegate.h"
25 #include "ui/compositor/layer.h" 26 #include "ui/compositor/layer.h"
26 #include "ui/gfx/display.h" 27 #include "ui/gfx/display.h"
27 #include "ui/gfx/geometry/rect.h" 28 #include "ui/gfx/geometry/rect.h"
28 #include "ui/views/view_constants_aura.h" 29 #include "ui/views/view_constants_aura.h"
29 #include "ui/views/widget/widget.h" 30 #include "ui/views/widget/widget.h"
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 (target_state == wm::WINDOW_STATE_TYPE_NORMAL && 250 (target_state == wm::WINDOW_STATE_TYPE_NORMAL &&
250 !window_state->CanMaximize()) || 251 !window_state->CanMaximize()) ||
251 target_state == wm::WINDOW_STATE_TYPE_FULLSCREEN); 252 target_state == wm::WINDOW_STATE_TYPE_FULLSCREEN);
252 253
253 if (target_state == wm::WINDOW_STATE_TYPE_MINIMIZED) { 254 if (target_state == wm::WINDOW_STATE_TYPE_MINIMIZED) {
254 if (current_state_type_ == wm::WINDOW_STATE_TYPE_MINIMIZED) 255 if (current_state_type_ == wm::WINDOW_STATE_TYPE_MINIMIZED)
255 return; 256 return;
256 257
257 current_state_type_ = target_state; 258 current_state_type_ = target_state;
258 ::wm::SetWindowVisibilityAnimationType( 259 ::wm::SetWindowVisibilityAnimationType(
259 window_state->aura_window(), WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE); 260 window_state->aura_window(),
261 wm::WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE);
260 window_state->window()->Hide(); 262 window_state->window()->Hide();
261 if (window_state->IsActive()) 263 if (window_state->IsActive())
262 window_state->Deactivate(); 264 window_state->Deactivate();
263 return; 265 return;
264 } 266 }
265 267
266 if (current_state_type_ == target_state) { 268 if (current_state_type_ == target_state) {
267 // If the state type did not change, update it accordingly. 269 // If the state type did not change, update it accordingly.
268 UpdateBounds(window_state, animated); 270 UpdateBounds(window_state, animated);
269 return; 271 return;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 // avoid flashing. 311 // avoid flashing.
310 if (window_state->IsMaximized()) 312 if (window_state->IsMaximized())
311 window_state->SetBoundsDirectCrossFade(bounds_in_parent); 313 window_state->SetBoundsDirectCrossFade(bounds_in_parent);
312 else 314 else
313 window_state->SetBoundsDirectAnimated(bounds_in_parent); 315 window_state->SetBoundsDirectAnimated(bounds_in_parent);
314 } 316 }
315 } 317 }
316 } 318 }
317 319
318 } // namespace ash 320 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/lock_window_state.cc ('k') | ash/wm/panels/panel_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698