OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/dock/docked_window_layout_manager.h" | 5 #include "ash/wm/dock/docked_window_layout_manager.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/launcher/launcher.h" | 8 #include "ash/launcher/launcher.h" |
9 #include "ash/screen_ash.h" | 9 #include "ash/screen_ash.h" |
10 #include "ash/shelf/shelf_layout_manager.h" | 10 #include "ash/shelf/shelf_layout_manager.h" |
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 wm::WindowShowType old_type) { | 558 wm::WindowShowType old_type) { |
559 aura::Window* window = window_state->window(); | 559 aura::Window* window = window_state->window(); |
560 if (IsPopupOrTransient(window)) | 560 if (IsPopupOrTransient(window)) |
561 return; | 561 return; |
562 // The window property will still be set, but no actual change will occur | 562 // The window property will still be set, but no actual change will occur |
563 // until OnFullscreenStateChange is called when exiting fullscreen. | 563 // until OnFullscreenStateChange is called when exiting fullscreen. |
564 if (in_fullscreen_) | 564 if (in_fullscreen_) |
565 return; | 565 return; |
566 if (window_state->IsMinimized()) { | 566 if (window_state->IsMinimized()) { |
567 MinimizeDockedWindow(window_state); | 567 MinimizeDockedWindow(window_state); |
568 } else if (window_state->IsMaximizedOrFullscreen()) { | 568 } else if (window_state->IsMaximizedOrFullscreen() || |
569 // Reparenting changes the source bounds for the animation if a window is | 569 window_state->IsSnapped()) { |
570 // visible so hide it here and show later when it is already in the desktop. | 570 if (window != dragged_window_) { |
571 UndockWindow(window); | 571 UndockWindow(window); |
572 RecordUmaAction(DOCKED_ACTION_MAXIMIZE, DOCKED_ACTION_SOURCE_UNKNOWN); | 572 RecordUmaAction(DOCKED_ACTION_MAXIMIZE, DOCKED_ACTION_SOURCE_UNKNOWN); |
| 573 } |
573 } else if (old_type == wm::SHOW_TYPE_MINIMIZED) { | 574 } else if (old_type == wm::SHOW_TYPE_MINIMIZED) { |
574 RestoreDockedWindow(window_state); | 575 RestoreDockedWindow(window_state); |
575 } | 576 } |
576 } | 577 } |
577 | 578 |
578 ///////////////////////////////////////////////////////////////////////////// | 579 ///////////////////////////////////////////////////////////////////////////// |
579 // DockLayoutManager, WindowObserver implementation: | 580 // DockLayoutManager, WindowObserver implementation: |
580 | 581 |
581 void DockedWindowLayoutManager::OnWindowBoundsChanged( | 582 void DockedWindowLayoutManager::OnWindowBoundsChanged( |
582 aura::Window* window, | 583 aura::Window* window, |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1054 void DockedWindowLayoutManager::OnKeyboardBoundsChanging( | 1055 void DockedWindowLayoutManager::OnKeyboardBoundsChanging( |
1055 const gfx::Rect& keyboard_bounds) { | 1056 const gfx::Rect& keyboard_bounds) { |
1056 // This bounds change will have caused a change to the Shelf which does not | 1057 // This bounds change will have caused a change to the Shelf which does not |
1057 // propagate automatically to this class, so manually recalculate bounds. | 1058 // propagate automatically to this class, so manually recalculate bounds. |
1058 Relayout(); | 1059 Relayout(); |
1059 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); | 1060 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); |
1060 } | 1061 } |
1061 | 1062 |
1062 } // namespace internal | 1063 } // namespace internal |
1063 } // namespace ash | 1064 } // namespace ash |
OLD | NEW |