Chromium Code Reviews| 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/screen_util.h" | 7 #include "ash/screen_util.h" |
| 8 #include "ash/shelf/shelf.h" | 8 #include "ash/shelf/shelf.h" |
| 9 #include "ash/shelf/shelf_constants.h" | 9 #include "ash/shelf/shelf_constants.h" |
| 10 #include "ash/shelf/shelf_layout_manager.h" | 10 #include "ash/shelf/shelf_layout_manager.h" |
| (...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 819 void DockedWindowLayoutManager::OnPreWindowStateTypeChange( | 819 void DockedWindowLayoutManager::OnPreWindowStateTypeChange( |
| 820 wm::WindowState* window_state, | 820 wm::WindowState* window_state, |
| 821 wm::WindowStateType old_type) { | 821 wm::WindowStateType old_type) { |
| 822 aura::Window* window = window_state->window(); | 822 aura::Window* window = window_state->window(); |
| 823 if (IsPopupOrTransient(window)) | 823 if (IsPopupOrTransient(window)) |
| 824 return; | 824 return; |
| 825 // The window property will still be set, but no actual change will occur | 825 // The window property will still be set, but no actual change will occur |
| 826 // until OnFullscreenStateChange is called when exiting fullscreen. | 826 // until OnFullscreenStateChange is called when exiting fullscreen. |
| 827 if (in_fullscreen_) | 827 if (in_fullscreen_) |
| 828 return; | 828 return; |
| 829 if (window_state->IsMinimized()) { | 829 if (!window_state->IsDocked() || |
| 830 MinimizeDockedWindow(window_state); | 830 window_state->IsMaximizedOrFullscreen() || |
| 831 } else if (window_state->IsMaximizedOrFullscreen() || | 831 window_state->IsSnapped()) { |
| 832 window_state->IsSnapped()) { | |
| 833 if (window != dragged_window_) { | 832 if (window != dragged_window_) { |
| 834 UndockWindow(window); | 833 UndockWindow(window); |
| 835 RecordUmaAction(DOCKED_ACTION_MAXIMIZE, DOCKED_ACTION_SOURCE_UNKNOWN); | 834 RecordUmaAction(DOCKED_ACTION_MAXIMIZE, DOCKED_ACTION_SOURCE_UNKNOWN); |
| 836 } | 835 } |
| 837 } else if (old_type == wm::WINDOW_STATE_TYPE_MINIMIZED) { | 836 } else if (window_state->IsMinimized()) { |
| 837 MinimizeDockedWindow(window_state); | |
| 838 } else if (old_type == wm::WINDOW_STATE_TYPE_DOCKED_MINIMIZED) { | |
|
varkha
2014/09/23 22:35:31
Maybe add NOTREACHED for WINDOW_STATE_TYPE_MINIMIZ
dtapuska
2014/09/26 14:17:07
Done.
| |
| 838 RestoreDockedWindow(window_state); | 839 RestoreDockedWindow(window_state); |
| 839 } | 840 } |
| 840 } | 841 } |
| 841 | 842 |
| 842 ///////////////////////////////////////////////////////////////////////////// | 843 ///////////////////////////////////////////////////////////////////////////// |
| 843 // DockedWindowLayoutManager, WindowObserver implementation: | 844 // DockedWindowLayoutManager, WindowObserver implementation: |
| 844 | 845 |
| 845 void DockedWindowLayoutManager::OnWindowBoundsChanged( | 846 void DockedWindowLayoutManager::OnWindowBoundsChanged( |
| 846 aura::Window* window, | 847 aura::Window* window, |
| 847 const gfx::Rect& old_bounds, | 848 const gfx::Rect& old_bounds, |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1331 | 1332 |
| 1332 void DockedWindowLayoutManager::OnKeyboardBoundsChanging( | 1333 void DockedWindowLayoutManager::OnKeyboardBoundsChanging( |
| 1333 const gfx::Rect& keyboard_bounds) { | 1334 const gfx::Rect& keyboard_bounds) { |
| 1334 // This bounds change will have caused a change to the Shelf which does not | 1335 // This bounds change will have caused a change to the Shelf which does not |
| 1335 // propagate automatically to this class, so manually recalculate bounds. | 1336 // propagate automatically to this class, so manually recalculate bounds. |
| 1336 Relayout(); | 1337 Relayout(); |
| 1337 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); | 1338 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); |
| 1338 } | 1339 } |
| 1339 | 1340 |
| 1340 } // namespace ash | 1341 } // namespace ash |
| OLD | NEW |