| 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 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 //////////////////////////////////////////////////////////////////////////////// | 494 //////////////////////////////////////////////////////////////////////////////// |
| 495 // DockLayoutManager, ash::ShellObserver implementation: | 495 // DockLayoutManager, ash::ShellObserver implementation: |
| 496 | 496 |
| 497 void DockedWindowLayoutManager::OnDisplayWorkAreaInsetsChanged() { | 497 void DockedWindowLayoutManager::OnDisplayWorkAreaInsetsChanged() { |
| 498 Relayout(); | 498 Relayout(); |
| 499 UpdateDockBounds(DockedWindowLayoutManagerObserver::DISPLAY_INSETS_CHANGED); | 499 UpdateDockBounds(DockedWindowLayoutManagerObserver::DISPLAY_INSETS_CHANGED); |
| 500 MaybeMinimizeChildrenExcept(dragged_window_); | 500 MaybeMinimizeChildrenExcept(dragged_window_); |
| 501 } | 501 } |
| 502 | 502 |
| 503 void DockedWindowLayoutManager::OnFullscreenStateChanged( | 503 void DockedWindowLayoutManager::OnFullscreenStateChanged( |
| 504 bool is_fullscreen, aura::RootWindow* root_window) { | 504 bool is_fullscreen, aura::Window* root_window) { |
| 505 if (dock_container_->GetRootWindow() != root_window) | 505 if (dock_container_->GetRootWindow() != root_window) |
| 506 return; | 506 return; |
| 507 // Entering fullscreen mode (including immersive) hides docked windows. | 507 // Entering fullscreen mode (including immersive) hides docked windows. |
| 508 in_fullscreen_ = workspace_controller_->GetWindowState() == | 508 in_fullscreen_ = workspace_controller_->GetWindowState() == |
| 509 WORKSPACE_WINDOW_STATE_FULL_SCREEN; | 509 WORKSPACE_WINDOW_STATE_FULL_SCREEN; |
| 510 { | 510 { |
| 511 // prevent Relayout from getting called multiple times during this | 511 // prevent Relayout from getting called multiple times during this |
| 512 base::AutoReset<bool> auto_reset_in_layout(&in_layout_, true); | 512 base::AutoReset<bool> auto_reset_in_layout(&in_layout_, true); |
| 513 // Use a copy of children array because a call to MinimizeDockedWindow or | 513 // Use a copy of children array because a call to MinimizeDockedWindow or |
| 514 // RestoreDockedWindow can change order. | 514 // RestoreDockedWindow can change order. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 526 if (!window_state->IsMinimized()) | 526 if (!window_state->IsMinimized()) |
| 527 RestoreDockedWindow(window_state); | 527 RestoreDockedWindow(window_state); |
| 528 } | 528 } |
| 529 } | 529 } |
| 530 } | 530 } |
| 531 Relayout(); | 531 Relayout(); |
| 532 UpdateDockBounds(DockedWindowLayoutManagerObserver::CHILD_CHANGED); | 532 UpdateDockBounds(DockedWindowLayoutManagerObserver::CHILD_CHANGED); |
| 533 } | 533 } |
| 534 | 534 |
| 535 void DockedWindowLayoutManager::OnShelfAlignmentChanged( | 535 void DockedWindowLayoutManager::OnShelfAlignmentChanged( |
| 536 aura::RootWindow* root_window) { | 536 aura::Window* root_window) { |
| 537 if (dock_container_->GetRootWindow() != root_window) | 537 if (dock_container_->GetRootWindow() != root_window) |
| 538 return; | 538 return; |
| 539 | 539 |
| 540 if (!launcher_ || !launcher_->shelf_widget()) | 540 if (!launcher_ || !launcher_->shelf_widget()) |
| 541 return; | 541 return; |
| 542 | 542 |
| 543 if (alignment_ == DOCKED_ALIGNMENT_NONE) | 543 if (alignment_ == DOCKED_ALIGNMENT_NONE) |
| 544 return; | 544 return; |
| 545 | 545 |
| 546 // Do not allow launcher and dock on the same side. Switch side that | 546 // Do not allow launcher and dock on the same side. Switch side that |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1013 void DockedWindowLayoutManager::OnKeyboardBoundsChanging( | 1013 void DockedWindowLayoutManager::OnKeyboardBoundsChanging( |
| 1014 const gfx::Rect& keyboard_bounds) { | 1014 const gfx::Rect& keyboard_bounds) { |
| 1015 // This bounds change will have caused a change to the Shelf which does not | 1015 // This bounds change will have caused a change to the Shelf which does not |
| 1016 // propagate automatically to this class, so manually recalculate bounds. | 1016 // propagate automatically to this class, so manually recalculate bounds. |
| 1017 Relayout(); | 1017 Relayout(); |
| 1018 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); | 1018 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); |
| 1019 } | 1019 } |
| 1020 | 1020 |
| 1021 } // namespace internal | 1021 } // namespace internal |
| 1022 } // namespace ash | 1022 } // namespace ash |
| OLD | NEW |