| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/dock/docked_window_resizer.h" | 5 #include "ash/wm/dock/docked_window_resizer.h" |
| 6 | 6 |
| 7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
| 8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
| 9 #include "ash/screen_util.h" | 9 #include "ash/screen_util.h" |
| 10 #include "ash/shelf/shelf.h" | 10 #include "ash/shelf/shelf.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 // At this point we are not yet animating the window as it may not be | 191 // At this point we are not yet animating the window as it may not be |
| 192 // inside the docked area. | 192 // inside the docked area. |
| 193 dock_layout_->StartDragging(GetTarget()); | 193 dock_layout_->StartDragging(GetTarget()); |
| 194 // Reparent workspace windows during the drag to elevate them above workspace. | 194 // Reparent workspace windows during the drag to elevate them above workspace. |
| 195 // Other windows for which the DockedWindowResizer is instantiated include | 195 // Other windows for which the DockedWindowResizer is instantiated include |
| 196 // panels and windows that are already docked. Those do not need reparenting. | 196 // panels and windows that are already docked. Those do not need reparenting. |
| 197 if (GetTarget()->type() != ui::wm::WINDOW_TYPE_PANEL && | 197 if (GetTarget()->type() != ui::wm::WINDOW_TYPE_PANEL && |
| 198 GetTarget()->parent()->id() == kShellWindowId_DefaultContainer) { | 198 GetTarget()->parent()->id() == kShellWindowId_DefaultContainer) { |
| 199 // Reparent the window into the docked windows container in order to get it | 199 // Reparent the window into the docked windows container in order to get it |
| 200 // on top of other docked windows. | 200 // on top of other docked windows. |
| 201 aura::Window* docked_container = Shell::GetContainer( | 201 wm::DockWindow(GetTarget()); |
| 202 GetTarget()->GetRootWindow(), | |
| 203 kShellWindowId_DockedContainer); | |
| 204 wm::ReparentChildWithTransientChildren(GetTarget(), | |
| 205 GetTarget()->parent(), | |
| 206 docked_container); | |
| 207 } | 202 } |
| 208 if (is_docked_) | 203 if (is_docked_) |
| 209 dock_layout_->DockDraggedWindow(GetTarget()); | 204 dock_layout_->DockDraggedWindow(GetTarget()); |
| 210 } | 205 } |
| 211 | 206 |
| 212 void DockedWindowResizer::FinishedDragging( | 207 void DockedWindowResizer::FinishedDragging( |
| 213 aura::client::WindowMoveResult move_result) { | 208 aura::client::WindowMoveResult move_result) { |
| 214 if (!did_move_or_resize_) | 209 if (!did_move_or_resize_) |
| 215 return; | 210 return; |
| 216 did_move_or_resize_ = false; | 211 did_move_or_resize_ = false; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 } else if (wm::GetWindowState(window)->IsDocked() && | 319 } else if (wm::GetWindowState(window)->IsDocked() && |
| 325 action == DOCKED_ACTION_UNDOCK) { | 320 action == DOCKED_ACTION_UNDOCK) { |
| 326 const wm::WMEvent event(wm::WM_EVENT_NORMAL); | 321 const wm::WMEvent event(wm::WM_EVENT_NORMAL); |
| 327 window_state_->OnWMEvent(&event); | 322 window_state_->OnWMEvent(&event); |
| 328 } | 323 } |
| 329 | 324 |
| 330 return action; | 325 return action; |
| 331 } | 326 } |
| 332 | 327 |
| 333 } // namespace ash | 328 } // namespace ash |
| OLD | NEW |