| 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 |
| 11 #include "ash/common/shelf/wm_shelf.h" | 11 #include "ash/common/shelf/wm_shelf.h" |
| 12 #include "ash/common/shelf/wm_shelf_util.h" | 12 #include "ash/common/shelf/wm_shelf_util.h" |
| 13 #include "ash/common/wm/overview/window_selector_controller.h" | 13 #include "ash/common/wm/overview/window_selector_controller.h" |
| 14 #include "ash/common/wm/window_animation_types.h" | 14 #include "ash/common/wm/window_animation_types.h" |
| 15 #include "ash/common/wm/window_parenting_utils.h" | 15 #include "ash/common/wm/window_parenting_utils.h" |
| 16 #include "ash/common/wm/window_state.h" | 16 #include "ash/common/wm/window_state.h" |
| 17 #include "ash/common/wm_shell.h" | 17 #include "ash/common/wm_shell.h" |
| 18 #include "ash/common/wm_window.h" | 18 #include "ash/common/wm_window.h" |
| 19 #include "ash/common/wm_window_property.h" | |
| 20 #include "ash/public/cpp/shell_window_ids.h" | 19 #include "ash/public/cpp/shell_window_ids.h" |
| 20 #include "ash/public/cpp/window_properties.h" |
| 21 #include "ash/root_window_controller.h" | 21 #include "ash/root_window_controller.h" |
| 22 #include "ash/wm/window_properties.h" | 22 #include "ash/wm/window_properties.h" |
| 23 #include "base/auto_reset.h" | 23 #include "base/auto_reset.h" |
| 24 #include "third_party/skia/include/core/SkColor.h" | 24 #include "third_party/skia/include/core/SkColor.h" |
| 25 #include "third_party/skia/include/core/SkPath.h" | 25 #include "third_party/skia/include/core/SkPath.h" |
| 26 #include "ui/compositor/scoped_layer_animation_settings.h" | 26 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 27 #include "ui/gfx/canvas.h" | 27 #include "ui/gfx/canvas.h" |
| 28 #include "ui/gfx/geometry/rect.h" | 28 #include "ui/gfx/geometry/rect.h" |
| 29 #include "ui/gfx/geometry/vector2d.h" | 29 #include "ui/gfx/geometry/vector2d.h" |
| 30 #include "ui/views/background.h" | 30 #include "ui/views/background.h" |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 void PanelLayoutManager::OnWindowResized() { | 332 void PanelLayoutManager::OnWindowResized() { |
| 333 Relayout(); | 333 Relayout(); |
| 334 } | 334 } |
| 335 | 335 |
| 336 void PanelLayoutManager::OnWindowAddedToLayout(WmWindow* child) { | 336 void PanelLayoutManager::OnWindowAddedToLayout(WmWindow* child) { |
| 337 if (child->GetType() == ui::wm::WINDOW_TYPE_POPUP) | 337 if (child->GetType() == ui::wm::WINDOW_TYPE_POPUP) |
| 338 return; | 338 return; |
| 339 if (in_add_window_) | 339 if (in_add_window_) |
| 340 return; | 340 return; |
| 341 base::AutoReset<bool> auto_reset_in_add_window(&in_add_window_, true); | 341 base::AutoReset<bool> auto_reset_in_add_window(&in_add_window_, true); |
| 342 if (!child->GetBoolProperty(WmWindowProperty::PANEL_ATTACHED)) { | 342 if (!child->aura_window()->GetProperty(kPanelAttachedKey)) { |
| 343 // This should only happen when a window is added to panel container as a | 343 // This should only happen when a window is added to panel container as a |
| 344 // result of bounds change from within the application during a drag. | 344 // result of bounds change from within the application during a drag. |
| 345 // If so we have already stopped the drag and should reparent the panel | 345 // If so we have already stopped the drag and should reparent the panel |
| 346 // back to appropriate container and ignore it. | 346 // back to appropriate container and ignore it. |
| 347 // TODO(varkha): Updating bounds during a drag can cause problems and a more | 347 // TODO(varkha): Updating bounds during a drag can cause problems and a more |
| 348 // general solution is needed. See http://crbug.com/251813 . | 348 // general solution is needed. See http://crbug.com/251813 . |
| 349 WmWindow* old_parent = child->GetParent(); | 349 WmWindow* old_parent = child->GetParent(); |
| 350 child->SetParentUsingContext(child, | 350 child->SetParentUsingContext(child, |
| 351 child->GetRootWindow()->GetBoundsInScreen()); | 351 child->GetRootWindow()->GetBoundsInScreen()); |
| 352 wm::ReparentTransientChildrenOfChild(child, old_parent, child->GetParent()); | 352 wm::ReparentTransientChildrenOfChild(child, old_parent, child->GetParent()); |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 920 } | 920 } |
| 921 } | 921 } |
| 922 // This bounds change will have caused a change to the Shelf which does not | 922 // This bounds change will have caused a change to the Shelf which does not |
| 923 // propogate automatically to this class, so manually recalculate bounds. | 923 // propogate automatically to this class, so manually recalculate bounds. |
| 924 OnWindowResized(); | 924 OnWindowResized(); |
| 925 } | 925 } |
| 926 | 926 |
| 927 void PanelLayoutManager::OnKeyboardClosed() {} | 927 void PanelLayoutManager::OnKeyboardClosed() {} |
| 928 | 928 |
| 929 } // namespace ash | 929 } // namespace ash |
| OLD | NEW |