| 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 if (!child->aura_window()->GetProperty(kPanelAttachedKey)) { | 344 if (!child->aura_window()->GetProperty(kPanelAttachedKey)) { |
| 345 // This should only happen when a window is added to panel container as a | 345 // This should only happen when a window is added to panel container as a |
| 346 // result of bounds change from within the application during a drag. | 346 // result of bounds change from within the application during a drag. |
| 347 // If so we have already stopped the drag and should reparent the panel | 347 // If so we have already stopped the drag and should reparent the panel |
| 348 // back to appropriate container and ignore it. | 348 // back to appropriate container and ignore it. |
| 349 // TODO(varkha): Updating bounds during a drag can cause problems and a more | 349 // TODO(varkha): Updating bounds during a drag can cause problems and a more |
| 350 // general solution is needed. See http://crbug.com/251813 . | 350 // general solution is needed. See http://crbug.com/251813 . |
| 351 WmWindow* old_parent = child->GetParent(); | 351 WmWindow* old_parent = child->GetParent(); |
| 352 child->SetParentUsingContext(child, | 352 child->SetParentUsingContext(child, |
| 353 child->GetRootWindow()->GetBoundsInScreen()); | 353 child->GetRootWindow()->GetBoundsInScreen()); |
| 354 wm::ReparentTransientChildrenOfChild(child, old_parent, child->GetParent()); | 354 wm::ReparentTransientChildrenOfChild(child->aura_window(), |
| 355 old_parent->aura_window(), |
| 356 child->GetParent()->aura_window()); |
| 355 DCHECK(child->GetParent()->GetShellWindowId() != | 357 DCHECK(child->GetParent()->GetShellWindowId() != |
| 356 kShellWindowId_PanelContainer); | 358 kShellWindowId_PanelContainer); |
| 357 return; | 359 return; |
| 358 } | 360 } |
| 359 PanelInfo panel_info; | 361 PanelInfo panel_info; |
| 360 panel_info.window = child; | 362 panel_info.window = child; |
| 361 panel_info.callout_widget = new PanelCalloutWidget(panel_container_); | 363 panel_info.callout_widget = new PanelCalloutWidget(panel_container_); |
| 362 panel_info.slide_in = child != dragged_panel_; | 364 panel_info.slide_in = child != dragged_panel_; |
| 363 panel_windows_.push_back(panel_info); | 365 panel_windows_.push_back(panel_info); |
| 364 child->aura_window()->AddObserver(this); | 366 child->aura_window()->AddObserver(this); |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 925 } | 927 } |
| 926 } | 928 } |
| 927 // This bounds change will have caused a change to the Shelf which does not | 929 // This bounds change will have caused a change to the Shelf which does not |
| 928 // propogate automatically to this class, so manually recalculate bounds. | 930 // propogate automatically to this class, so manually recalculate bounds. |
| 929 OnWindowResized(); | 931 OnWindowResized(); |
| 930 } | 932 } |
| 931 | 933 |
| 932 void PanelLayoutManager::OnKeyboardClosed() {} | 934 void PanelLayoutManager::OnKeyboardClosed() {} |
| 933 | 935 |
| 934 } // namespace ash | 936 } // namespace ash |
| OLD | NEW |