| 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 "ui/base/hit_test.h" | 10 #include "ui/base/hit_test.h" |
| 10 #include "ui/compositor/layer.h" | 11 #include "ui/compositor/layer.h" |
| 11 | 12 |
| 12 namespace ash { | 13 namespace ash { |
| 13 | 14 |
| 14 namespace { | 15 namespace { |
| 15 | 16 |
| 16 int GetSizeChangeDirectionForWindowComponent(int window_component) { | 17 int GetSizeChangeDirectionForWindowComponent(int window_component) { |
| 17 int size_change_direction = WindowResizer::kBoundsChangeDirection_None; | 18 int size_change_direction = WindowResizer::kBoundsChangeDirection_None; |
| 18 switch (window_component) { | 19 switch (window_component) { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 window_component(window_component), | 54 window_component(window_component), |
| 54 bounds_change( | 55 bounds_change( |
| 55 WindowResizer::GetBoundsChangeForWindowComponent(window_component)), | 56 WindowResizer::GetBoundsChangeForWindowComponent(window_component)), |
| 56 position_change_direction( | 57 position_change_direction( |
| 57 WindowResizer::GetPositionChangeDirectionForWindowComponent( | 58 WindowResizer::GetPositionChangeDirectionForWindowComponent( |
| 58 window_component)), | 59 window_component)), |
| 59 size_change_direction( | 60 size_change_direction( |
| 60 GetSizeChangeDirectionForWindowComponent(window_component)), | 61 GetSizeChangeDirectionForWindowComponent(window_component)), |
| 61 is_resizable(bounds_change != WindowResizer::kBoundsChangeDirection_None), | 62 is_resizable(bounds_change != WindowResizer::kBoundsChangeDirection_None), |
| 62 source(source), | 63 source(source), |
| 63 should_attach_to_shelf(window->GetType() == ui::wm::WINDOW_TYPE_PANEL && | 64 should_attach_to_shelf( |
| 64 window->GetWindowState()->panel_attached()) { | 65 window->GetType() == ui::wm::WINDOW_TYPE_PANEL && |
| 66 window->GetBoolProperty(WmWindowProperty::PANEL_ATTACHED)) { |
| 65 wm::WindowState* window_state = window->GetWindowState(); | 67 wm::WindowState* window_state = window->GetWindowState(); |
| 66 if ((window_state->IsNormalOrSnapped() || window_state->IsDocked()) && | 68 if ((window_state->IsNormalOrSnapped() || window_state->IsDocked()) && |
| 67 window_state->HasRestoreBounds() && window_component == HTCAPTION) { | 69 window_state->HasRestoreBounds() && window_component == HTCAPTION) { |
| 68 restore_bounds = window_state->GetRestoreBoundsInScreen(); | 70 restore_bounds = window_state->GetRestoreBoundsInScreen(); |
| 69 } | 71 } |
| 70 } | 72 } |
| 71 | 73 |
| 72 DragDetails::~DragDetails() {} | 74 DragDetails::~DragDetails() {} |
| 73 | 75 |
| 74 } // namespace ash | 76 } // namespace ash |
| OLD | NEW |