| 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/common/wm/panels/panel_layout_manager.h" | 5 #include "ash/common/wm/panels/panel_layout_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 gfx::Rect icon_bounds = shelf_->GetScreenBoundsOfItemIconForWindow(panel); | 660 gfx::Rect icon_bounds = shelf_->GetScreenBoundsOfItemIconForWindow(panel); |
| 661 | 661 |
| 662 // If both the icon width and height are 0 then there is no icon in the | 662 // If both the icon width and height are 0 then there is no icon in the |
| 663 // shelf. If the shelf is hidden, one of the height or width will be | 663 // shelf. If the shelf is hidden, one of the height or width will be |
| 664 // 0 but the position in the shelf and major dimension is still reported | 664 // 0 but the position in the shelf and major dimension is still reported |
| 665 // correctly and the panel can be aligned above where the hidden icon is. | 665 // correctly and the panel can be aligned above where the hidden icon is. |
| 666 if (icon_bounds.width() == 0 && icon_bounds.height() == 0) | 666 if (icon_bounds.width() == 0 && icon_bounds.height() == 0) |
| 667 continue; | 667 continue; |
| 668 | 668 |
| 669 if (panel->IsFocused() || | 669 if (panel->IsFocused() || |
| 670 panel->Contains(panel->GetShell()->GetFocusedWindow())) { | 670 panel->Contains(WmWindow::Get(wm::GetFocusedWindow()))) { |
| 671 DCHECK(!active_panel); | 671 DCHECK(!active_panel); |
| 672 active_panel = panel; | 672 active_panel = panel; |
| 673 } | 673 } |
| 674 icon_bounds = panel_container_->ConvertRectFromScreen(icon_bounds); | 674 icon_bounds = panel_container_->ConvertRectFromScreen(icon_bounds); |
| 675 gfx::Point icon_origin = icon_bounds.origin(); | 675 gfx::Point icon_origin = icon_bounds.origin(); |
| 676 VisiblePanelPositionInfo position_info; | 676 VisiblePanelPositionInfo position_info; |
| 677 int icon_start = horizontal ? icon_origin.x() : icon_origin.y(); | 677 int icon_start = horizontal ? icon_origin.x() : icon_origin.y(); |
| 678 int icon_end = | 678 int icon_end = |
| 679 icon_start + (horizontal ? icon_bounds.width() : icon_bounds.height()); | 679 icon_start + (horizontal ? icon_bounds.width() : icon_bounds.height()); |
| 680 position_info.major_length = | 680 position_info.major_length = |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 942 // This bounds change will have caused a change to the Shelf which does not | 942 // This bounds change will have caused a change to the Shelf which does not |
| 943 // propogate automatically to this class, so manually recalculate bounds. | 943 // propogate automatically to this class, so manually recalculate bounds. |
| 944 OnWindowResized(); | 944 OnWindowResized(); |
| 945 } | 945 } |
| 946 | 946 |
| 947 void PanelLayoutManager::OnKeyboardClosed() { | 947 void PanelLayoutManager::OnKeyboardClosed() { |
| 948 keyboard_observer_.RemoveAll(); | 948 keyboard_observer_.RemoveAll(); |
| 949 } | 949 } |
| 950 | 950 |
| 951 } // namespace ash | 951 } // namespace ash |
| OLD | NEW |