Chromium Code Reviews| 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/panels/panel_layout_manager.h" | 5 #include "ash/wm/panels/panel_layout_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "ash/screen_util.h" | 10 #include "ash/screen_util.h" |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 477 intptr_t old) { | 477 intptr_t old) { |
| 478 // Trigger a relayout to position the panels whenever the panel icon is set | 478 // Trigger a relayout to position the panels whenever the panel icon is set |
| 479 // or changes. | 479 // or changes. |
| 480 if (key == kShelfID) | 480 if (key == kShelfID) |
| 481 Relayout(); | 481 Relayout(); |
| 482 } | 482 } |
| 483 | 483 |
| 484 ///////////////////////////////////////////////////////////////////////////// | 484 ///////////////////////////////////////////////////////////////////////////// |
| 485 // PanelLayoutManager, WindowStateObserver implementation: | 485 // PanelLayoutManager, WindowStateObserver implementation: |
| 486 | 486 |
| 487 void PanelLayoutManager::OnPreWindowStateTypeChange( | |
|
varkha
2014/09/24 03:16:23
Would be nice to move this into some place that is
dtapuska
2014/09/25 23:27:09
I collapsed the moving code; but the state managem
| |
| 488 wm::WindowState* window_state, | |
| 489 wm::WindowStateType old_type) { | |
| 490 aura::Window* window = window_state->window(); | |
| 491 if (window_state->IsDocked()) { | |
| 492 // Reparent the window into the docked windows container in order to get it | |
| 493 // on top of other docked windows. | |
| 494 aura::Window* docked_container = Shell::GetContainer( | |
| 495 window->GetRootWindow(), | |
| 496 kShellWindowId_DockedContainer); | |
| 497 wm::ReparentChildWithTransientChildren(window, | |
| 498 window->parent(), | |
| 499 docked_container); | |
| 500 } | |
| 501 } | |
| 502 | |
| 487 void PanelLayoutManager::OnPostWindowStateTypeChange( | 503 void PanelLayoutManager::OnPostWindowStateTypeChange( |
| 488 wm::WindowState* window_state, | 504 wm::WindowState* window_state, |
| 489 wm::WindowStateType old_type) { | 505 wm::WindowStateType old_type) { |
| 490 // If the shelf is currently hidden then windows will not actually be shown | 506 // If the shelf is currently hidden then windows will not actually be shown |
| 491 // but the set to restore when the shelf becomes visible is updated. | 507 // but the set to restore when the shelf becomes visible is updated. |
| 492 if (restore_windows_on_shelf_visible_) { | 508 if (restore_windows_on_shelf_visible_) { |
| 493 if (window_state->IsMinimized()) { | 509 if (window_state->IsMinimized()) { |
| 494 MinimizePanel(window_state->window()); | 510 MinimizePanel(window_state->window()); |
| 495 restore_windows_on_shelf_visible_->Remove(window_state->window()); | 511 restore_windows_on_shelf_visible_->Remove(window_state->window()); |
| 496 } else { | 512 } else { |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 932 // Keyboard hidden, restore original bounds if they exist. | 948 // Keyboard hidden, restore original bounds if they exist. |
| 933 SetChildBounds(panel, panel_state->GetRestoreBoundsInScreen()); | 949 SetChildBounds(panel, panel_state->GetRestoreBoundsInScreen()); |
| 934 } | 950 } |
| 935 } | 951 } |
| 936 // This bounds change will have caused a change to the Shelf which does not | 952 // This bounds change will have caused a change to the Shelf which does not |
| 937 // propogate automatically to this class, so manually recalculate bounds. | 953 // propogate automatically to this class, so manually recalculate bounds. |
| 938 OnWindowResized(); | 954 OnWindowResized(); |
| 939 } | 955 } |
| 940 | 956 |
| 941 } // namespace ash | 957 } // namespace ash |
| OLD | NEW |