| 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/launcher/launcher.h" | 8 #include "ash/launcher/launcher.h" |
| 9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
| 10 #include "ash/screen_ash.h" | 10 #include "ash/screen_ash.h" |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 } | 219 } |
| 220 } | 220 } |
| 221 return false; | 221 return false; |
| 222 } | 222 } |
| 223 | 223 |
| 224 void DockedWindowResizer::StartedDragging() { | 224 void DockedWindowResizer::StartedDragging() { |
| 225 // During resizing the window width is preserved by DockedwindowLayoutManager. | 225 // During resizing the window width is preserved by DockedwindowLayoutManager. |
| 226 wm::WindowState* window_state = wm::GetWindowState(GetTarget()); | 226 wm::WindowState* window_state = wm::GetWindowState(GetTarget()); |
| 227 if (is_docked_ && | 227 if (is_docked_ && |
| 228 (details_.bounds_change & WindowResizer::kBoundsChange_Resizes)) { | 228 (details_.bounds_change & WindowResizer::kBoundsChange_Resizes)) { |
| 229 window_state->set_bounds_changed_by_user(true); | 229 window_state->SetBoundsChangedByUser(true); |
| 230 } | 230 } |
| 231 | 231 |
| 232 // Tell the dock layout manager that we are dragging this window. | 232 // Tell the dock layout manager that we are dragging this window. |
| 233 // At this point we are not yet animating the window as it may not be | 233 // At this point we are not yet animating the window as it may not be |
| 234 // inside the docked area. | 234 // inside the docked area. |
| 235 dock_layout_->StartDragging(GetTarget()); | 235 dock_layout_->StartDragging(GetTarget()); |
| 236 // Reparent workspace windows during the drag to elevate them above workspace. | 236 // Reparent workspace windows during the drag to elevate them above workspace. |
| 237 // Other windows for which the DockedWindowResizer is instantiated include | 237 // Other windows for which the DockedWindowResizer is instantiated include |
| 238 // panels and windows that are already docked. Those do not need reparenting. | 238 // panels and windows that are already docked. Those do not need reparenting. |
| 239 if (GetTarget()->type() != aura::client::WINDOW_TYPE_PANEL && | 239 if (GetTarget()->type() != aura::client::WINDOW_TYPE_PANEL && |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 else if (is_docked_ && !was_docked_) | 339 else if (is_docked_ && !was_docked_) |
| 340 action = DOCKED_ACTION_DOCK; | 340 action = DOCKED_ACTION_DOCK; |
| 341 else | 341 else |
| 342 action = DOCKED_ACTION_NONE; | 342 action = DOCKED_ACTION_NONE; |
| 343 } | 343 } |
| 344 // When a window is newly docked it is auto-sized by docked layout adjusting | 344 // When a window is newly docked it is auto-sized by docked layout adjusting |
| 345 // to other windows. If it is just dragged (but not resized) while being | 345 // to other windows. If it is just dragged (but not resized) while being |
| 346 // docked it is auto-sized unless it has been resized while being docked | 346 // docked it is auto-sized unless it has been resized while being docked |
| 347 // before. | 347 // before. |
| 348 if (is_docked_) { | 348 if (is_docked_) { |
| 349 wm::GetWindowState(window)->set_bounds_changed_by_user( | 349 wm::GetWindowState(window)->SetBoundsChangedByUser( |
| 350 was_docked_ && (is_resized || was_bounds_changed_by_user_)); | 350 was_docked_ && (is_resized || was_bounds_changed_by_user_)); |
| 351 } | 351 } |
| 352 return action; | 352 return action; |
| 353 } | 353 } |
| 354 | 354 |
| 355 } // namespace internal | 355 } // namespace internal |
| 356 } // namespace ash | 356 } // namespace ash |
| OLD | NEW |