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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 if (in_add_window_) | 341 if (in_add_window_) |
342 return; | 342 return; |
343 base::AutoReset<bool> auto_reset_in_add_window(&in_add_window_, true); | 343 base::AutoReset<bool> auto_reset_in_add_window(&in_add_window_, true); |
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 aura::Window* old_parent = child->aura_window()->parent(); |
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(), old_parent, |
| 355 child->aura_window()->parent()); |
355 DCHECK(child->GetParent()->GetShellWindowId() != | 356 DCHECK(child->GetParent()->GetShellWindowId() != |
356 kShellWindowId_PanelContainer); | 357 kShellWindowId_PanelContainer); |
357 return; | 358 return; |
358 } | 359 } |
359 PanelInfo panel_info; | 360 PanelInfo panel_info; |
360 panel_info.window = child; | 361 panel_info.window = child; |
361 panel_info.callout_widget = new PanelCalloutWidget(panel_container_); | 362 panel_info.callout_widget = new PanelCalloutWidget(panel_container_); |
362 panel_info.slide_in = child != dragged_panel_; | 363 panel_info.slide_in = child != dragged_panel_; |
363 panel_windows_.push_back(panel_info); | 364 panel_windows_.push_back(panel_info); |
364 child->aura_window()->AddObserver(this); | 365 child->aura_window()->AddObserver(this); |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
925 } | 926 } |
926 } | 927 } |
927 // This bounds change will have caused a change to the Shelf which does not | 928 // This bounds change will have caused a change to the Shelf which does not |
928 // propogate automatically to this class, so manually recalculate bounds. | 929 // propogate automatically to this class, so manually recalculate bounds. |
929 OnWindowResized(); | 930 OnWindowResized(); |
930 } | 931 } |
931 | 932 |
932 void PanelLayoutManager::OnKeyboardClosed() {} | 933 void PanelLayoutManager::OnKeyboardClosed() {} |
933 | 934 |
934 } // namespace ash | 935 } // namespace ash |
OLD | NEW |