| 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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 //////////////////////////////////////////////////////////////////////////////// | 507 //////////////////////////////////////////////////////////////////////////////// |
| 508 // DockLayoutManager, ash::ShellObserver implementation: | 508 // DockLayoutManager, ash::ShellObserver implementation: |
| 509 | 509 |
| 510 void DockedWindowLayoutManager::OnDisplayWorkAreaInsetsChanged() { | 510 void DockedWindowLayoutManager::OnDisplayWorkAreaInsetsChanged() { |
| 511 Relayout(); | 511 Relayout(); |
| 512 UpdateDockBounds(DockedWindowLayoutManagerObserver::DISPLAY_INSETS_CHANGED); | 512 UpdateDockBounds(DockedWindowLayoutManagerObserver::DISPLAY_INSETS_CHANGED); |
| 513 MaybeMinimizeChildrenExcept(dragged_window_); | 513 MaybeMinimizeChildrenExcept(dragged_window_); |
| 514 } | 514 } |
| 515 | 515 |
| 516 void DockedWindowLayoutManager::OnFullscreenStateChanged( | 516 void DockedWindowLayoutManager::OnFullscreenStateChanged( |
| 517 bool is_fullscreen, aura::RootWindow* root_window) { | 517 bool is_fullscreen, aura::Window* root_window) { |
| 518 if (dock_container_->GetRootWindow() != root_window) | 518 if (dock_container_->GetRootWindow() != root_window) |
| 519 return; | 519 return; |
| 520 // Entering fullscreen mode (including immersive) hides docked windows. | 520 // Entering fullscreen mode (including immersive) hides docked windows. |
| 521 in_fullscreen_ = workspace_controller_->GetWindowState() == | 521 in_fullscreen_ = workspace_controller_->GetWindowState() == |
| 522 WORKSPACE_WINDOW_STATE_FULL_SCREEN; | 522 WORKSPACE_WINDOW_STATE_FULL_SCREEN; |
| 523 { | 523 { |
| 524 // prevent Relayout from getting called multiple times during this | 524 // prevent Relayout from getting called multiple times during this |
| 525 base::AutoReset<bool> auto_reset_in_layout(&in_layout_, true); | 525 base::AutoReset<bool> auto_reset_in_layout(&in_layout_, true); |
| 526 // Use a copy of children array because a call to MinimizeDockedWindow or | 526 // Use a copy of children array because a call to MinimizeDockedWindow or |
| 527 // RestoreDockedWindow can change order. | 527 // RestoreDockedWindow can change order. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 539 if (!window_state->IsMinimized()) | 539 if (!window_state->IsMinimized()) |
| 540 RestoreDockedWindow(window_state); | 540 RestoreDockedWindow(window_state); |
| 541 } | 541 } |
| 542 } | 542 } |
| 543 } | 543 } |
| 544 Relayout(); | 544 Relayout(); |
| 545 UpdateDockBounds(DockedWindowLayoutManagerObserver::CHILD_CHANGED); | 545 UpdateDockBounds(DockedWindowLayoutManagerObserver::CHILD_CHANGED); |
| 546 } | 546 } |
| 547 | 547 |
| 548 void DockedWindowLayoutManager::OnShelfAlignmentChanged( | 548 void DockedWindowLayoutManager::OnShelfAlignmentChanged( |
| 549 aura::RootWindow* root_window) { | 549 aura::Window* root_window) { |
| 550 if (dock_container_->GetRootWindow() != root_window) | 550 if (dock_container_->GetRootWindow() != root_window) |
| 551 return; | 551 return; |
| 552 | 552 |
| 553 if (!launcher_ || !launcher_->shelf_widget()) | 553 if (!launcher_ || !launcher_->shelf_widget()) |
| 554 return; | 554 return; |
| 555 | 555 |
| 556 if (alignment_ == DOCKED_ALIGNMENT_NONE) | 556 if (alignment_ == DOCKED_ALIGNMENT_NONE) |
| 557 return; | 557 return; |
| 558 | 558 |
| 559 // Do not allow launcher and dock on the same side. Switch side that | 559 // 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... |
| 1026 void DockedWindowLayoutManager::OnKeyboardBoundsChanging( | 1026 void DockedWindowLayoutManager::OnKeyboardBoundsChanging( |
| 1027 const gfx::Rect& keyboard_bounds) { | 1027 const gfx::Rect& keyboard_bounds) { |
| 1028 // This bounds change will have caused a change to the Shelf which does not | 1028 // This bounds change will have caused a change to the Shelf which does not |
| 1029 // propagate automatically to this class, so manually recalculate bounds. | 1029 // propagate automatically to this class, so manually recalculate bounds. |
| 1030 Relayout(); | 1030 Relayout(); |
| 1031 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); | 1031 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); |
| 1032 } | 1032 } |
| 1033 | 1033 |
| 1034 } // namespace internal | 1034 } // namespace internal |
| 1035 } // namespace ash | 1035 } // namespace ash |
| OLD | NEW |