OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/workspace/workspace_layout_manager.h" | 5 #include "ash/wm/workspace/workspace_layout_manager.h" |
6 | 6 |
7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
9 #include "ash/screen_util.h" | 9 #include "ash/screen_util.h" |
10 #include "ash/session_state_delegate.h" | 10 #include "ash/session_state_delegate.h" |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 if (window_state->IsFullscreen() || old_type == wm::SHOW_TYPE_FULLSCREEN) | 288 if (window_state->IsFullscreen() || old_type == wm::SHOW_TYPE_FULLSCREEN) |
289 UpdateFullscreenState(); | 289 UpdateFullscreenState(); |
290 | 290 |
291 UpdateShelfVisibility(); | 291 UpdateShelfVisibility(); |
292 } | 292 } |
293 | 293 |
294 void WorkspaceLayoutManager::ShowTypeChanged( | 294 void WorkspaceLayoutManager::ShowTypeChanged( |
295 wm::WindowState* window_state, | 295 wm::WindowState* window_state, |
296 wm::WindowShowType last_show_type) { | 296 wm::WindowShowType last_show_type) { |
297 if (window_state->IsMinimized()) { | 297 if (window_state->IsMinimized()) { |
298 if (last_show_type == wm::SHOW_TYPE_MINIMIZED) | |
299 return; | |
300 | |
301 // Save the previous show state so that we can correctly restore it. | 298 // Save the previous show state so that we can correctly restore it. |
302 window_state->window()->SetProperty(aura::client::kRestoreShowStateKey, | 299 window_state->window()->SetProperty(aura::client::kRestoreShowStateKey, |
303 wm::ToWindowShowState(last_show_type)); | 300 wm::ToWindowShowState(last_show_type)); |
304 views::corewm::SetWindowVisibilityAnimationType( | 301 views::corewm::SetWindowVisibilityAnimationType( |
305 window_state->window(), WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE); | 302 window_state->window(), WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE); |
306 | 303 |
307 // Hide the window. | 304 // Hide the window. |
308 window_state->window()->Hide(); | 305 window_state->window()->Hide(); |
309 // Activate another window. | 306 // Activate another window. |
310 if (window_state->IsActive()) | 307 if (window_state->IsActive()) |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 case ADJUST_WINDOW_DISPLAY_SIZE_CHANGED: | 373 case ADJUST_WINDOW_DISPLAY_SIZE_CHANGED: |
377 // The work area may be smaller than the full screen. Put as much of the | 374 // The work area may be smaller than the full screen. Put as much of the |
378 // window as possible within the display area. | 375 // window as possible within the display area. |
379 bounds.AdjustToFit(work_area_in_parent_); | 376 bounds.AdjustToFit(work_area_in_parent_); |
380 break; | 377 break; |
381 case ADJUST_WINDOW_WORK_AREA_INSETS_CHANGED: | 378 case ADJUST_WINDOW_WORK_AREA_INSETS_CHANGED: |
382 ash::wm::AdjustBoundsToEnsureMinimumWindowVisibility( | 379 ash::wm::AdjustBoundsToEnsureMinimumWindowVisibility( |
383 work_area_in_parent_, &bounds); | 380 work_area_in_parent_, &bounds); |
384 break; | 381 break; |
385 } | 382 } |
386 AdjustSnappedBounds(window_state, &bounds); | 383 //AdjustSnappedBounds(window_state, &bounds); |
387 if (window_state->window()->bounds() != bounds) | 384 if (window_state->window()->bounds() != bounds) |
388 SetChildBoundsAnimated(window_state->window(), bounds); | 385 SetChildBoundsAnimated(window_state->window(), bounds); |
389 } | 386 } |
390 | 387 |
391 void WorkspaceLayoutManager::AdjustWindowBoundsWhenAdded( | 388 void WorkspaceLayoutManager::AdjustWindowBoundsWhenAdded( |
392 wm::WindowState* window_state) { | 389 wm::WindowState* window_state) { |
393 // Don't adjust window bounds if the bounds are empty as this | 390 // Don't adjust window bounds if the bounds are empty as this |
394 // happens when a new views::Widget is created. | 391 // happens when a new views::Widget is created. |
395 // When a window is dragged and dropped onto a different | 392 // When a window is dragged and dropped onto a different |
396 // root window, the bounds will be updated after they are added | 393 // root window, the bounds will be updated after they are added |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 ui::ScopedLayerAnimationSettings slide_settings(layer->GetAnimator()); | 533 ui::ScopedLayerAnimationSettings slide_settings(layer->GetAnimator()); |
537 slide_settings.SetPreemptionStrategy( | 534 slide_settings.SetPreemptionStrategy( |
538 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); | 535 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); |
539 slide_settings.SetTransitionDuration( | 536 slide_settings.SetTransitionDuration( |
540 base::TimeDelta::FromMilliseconds(kBoundsChangeSlideDurationMs)); | 537 base::TimeDelta::FromMilliseconds(kBoundsChangeSlideDurationMs)); |
541 SetChildBoundsDirect(child, bounds); | 538 SetChildBoundsDirect(child, bounds); |
542 } | 539 } |
543 | 540 |
544 } // namespace internal | 541 } // namespace internal |
545 } // namespace ash | 542 } // namespace ash |
OLD | NEW |