Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/drag_details.h" | 5 #include "ash/common/wm/drag_details.h" |
| 6 | 6 |
| 7 #include "ash/common/wm/window_resizer.h" | 7 #include "ash/common/wm/window_resizer.h" |
| 8 #include "ash/common/wm_window.h" | 8 #include "ash/common/wm_window.h" |
| 9 #include "ash/common/wm_window_property.h" | 9 #include "ash/common/wm_window_property.h" |
| 10 #include "ui/base/hit_test.h" | 10 #include "ui/base/hit_test.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 | 43 |
| 44 } // namespace | 44 } // namespace |
| 45 | 45 |
| 46 DragDetails::DragDetails(WmWindow* window, | 46 DragDetails::DragDetails(WmWindow* window, |
| 47 const gfx::Point& location, | 47 const gfx::Point& location, |
| 48 int window_component, | 48 int window_component, |
| 49 aura::client::WindowMoveSource source) | 49 aura::client::WindowMoveSource source) |
| 50 : initial_state_type(window->GetWindowState()->GetStateType()), | 50 : initial_state_type(window->GetWindowState()->GetStateType()), |
| 51 initial_bounds_in_parent(window->GetBounds()), | 51 initial_bounds_in_parent(window->GetBounds()), |
| 52 initial_location_in_parent(location), | 52 initial_location_in_parent(location), |
| 53 initial_opacity(window->GetLayer()->opacity()), | 53 // When drag starts, we might be in the middle of a window opacity |
| 54 // animation, on drag completion we must set the opacity to the target | |
| 55 // opacity rather than the current opacity (crbug.com/687003). | |
| 56 initial_opacity(window->GetLayer()->GetTargetOpacity()), | |
|
sky
2017/02/06 22:37:59
This is subtle. I would be nice to have test cover
| |
| 54 window_component(window_component), | 57 window_component(window_component), |
| 55 bounds_change( | 58 bounds_change( |
| 56 WindowResizer::GetBoundsChangeForWindowComponent(window_component)), | 59 WindowResizer::GetBoundsChangeForWindowComponent(window_component)), |
| 57 position_change_direction( | 60 position_change_direction( |
| 58 WindowResizer::GetPositionChangeDirectionForWindowComponent( | 61 WindowResizer::GetPositionChangeDirectionForWindowComponent( |
| 59 window_component)), | 62 window_component)), |
| 60 size_change_direction( | 63 size_change_direction( |
| 61 GetSizeChangeDirectionForWindowComponent(window_component)), | 64 GetSizeChangeDirectionForWindowComponent(window_component)), |
| 62 is_resizable(bounds_change != WindowResizer::kBoundsChangeDirection_None), | 65 is_resizable(bounds_change != WindowResizer::kBoundsChangeDirection_None), |
| 63 source(source), | 66 source(source), |
| 64 should_attach_to_shelf( | 67 should_attach_to_shelf( |
| 65 window->GetType() == ui::wm::WINDOW_TYPE_PANEL && | 68 window->GetType() == ui::wm::WINDOW_TYPE_PANEL && |
| 66 window->GetBoolProperty(WmWindowProperty::PANEL_ATTACHED)) { | 69 window->GetBoolProperty(WmWindowProperty::PANEL_ATTACHED)) { |
| 67 wm::WindowState* window_state = window->GetWindowState(); | 70 wm::WindowState* window_state = window->GetWindowState(); |
| 68 if ((window_state->IsNormalOrSnapped() || window_state->IsDocked()) && | 71 if ((window_state->IsNormalOrSnapped() || window_state->IsDocked()) && |
| 69 window_state->HasRestoreBounds() && window_component == HTCAPTION) { | 72 window_state->HasRestoreBounds() && window_component == HTCAPTION) { |
| 70 restore_bounds = window_state->GetRestoreBoundsInScreen(); | 73 restore_bounds = window_state->GetRestoreBoundsInScreen(); |
| 71 } | 74 } |
| 72 } | 75 } |
| 73 | 76 |
| 74 DragDetails::~DragDetails() {} | 77 DragDetails::~DragDetails() {} |
| 75 | 78 |
| 76 } // namespace ash | 79 } // namespace ash |
| OLD | NEW |