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/wm/workspace/workspace_window_resizer.h" | 5 #include "ash/wm/workspace/workspace_window_resizer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 if (!window_state->IsNormalOrSnapped()) | 65 if (!window_state->IsNormalOrSnapped()) |
66 return std::unique_ptr<WindowResizer>(); | 66 return std::unique_ptr<WindowResizer>(); |
67 | 67 |
68 int bounds_change = | 68 int bounds_change = |
69 WindowResizer::GetBoundsChangeForWindowComponent(window_component); | 69 WindowResizer::GetBoundsChangeForWindowComponent(window_component); |
70 if (bounds_change == WindowResizer::kBoundsChangeDirection_None) | 70 if (bounds_change == WindowResizer::kBoundsChangeDirection_None) |
71 return std::unique_ptr<WindowResizer>(); | 71 return std::unique_ptr<WindowResizer>(); |
72 | 72 |
73 window_state->CreateDragDetails(point_in_parent, window_component, source); | 73 window_state->CreateDragDetails(point_in_parent, window_component, source); |
74 const int parent_shell_window_id = | 74 const int parent_shell_window_id = |
75 window->GetParent() ? window->GetParent()->GetShellWindowId() : -1; | 75 window->GetParent() ? window->GetParent()->aura_window()->id() : -1; |
76 if (window->GetParent() && | 76 if (window->GetParent() && |
77 (parent_shell_window_id == kShellWindowId_DefaultContainer || | 77 (parent_shell_window_id == kShellWindowId_DefaultContainer || |
78 parent_shell_window_id == kShellWindowId_PanelContainer)) { | 78 parent_shell_window_id == kShellWindowId_PanelContainer)) { |
79 window_resizer.reset( | 79 window_resizer.reset( |
80 WorkspaceWindowResizer::Create(window_state, std::vector<WmWindow*>())); | 80 WorkspaceWindowResizer::Create(window_state, std::vector<WmWindow*>())); |
81 } else { | 81 } else { |
82 window_resizer.reset(DefaultWindowResizer::Create(window_state)); | 82 window_resizer.reset(DefaultWindowResizer::Create(window_state)); |
83 } | 83 } |
84 window_resizer = ShellPort::Get()->CreateDragWindowResizer( | 84 window_resizer = ShellPort::Get()->CreateDragWindowResizer( |
85 std::move(window_resizer), window_state); | 85 std::move(window_resizer), window_state); |
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
948 DCHECK(snapped_type == wm::WINDOW_STATE_TYPE_LEFT_SNAPPED || | 948 DCHECK(snapped_type == wm::WINDOW_STATE_TYPE_LEFT_SNAPPED || |
949 snapped_type == wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED); | 949 snapped_type == wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED); |
950 gfx::Rect snapped_bounds = wm::GetDisplayWorkAreaBoundsInParent(GetTarget()); | 950 gfx::Rect snapped_bounds = wm::GetDisplayWorkAreaBoundsInParent(GetTarget()); |
951 if (snapped_type == wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED) | 951 if (snapped_type == wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED) |
952 snapped_bounds.set_x(snapped_bounds.right() - bounds_in_parent.width()); | 952 snapped_bounds.set_x(snapped_bounds.right() - bounds_in_parent.width()); |
953 snapped_bounds.set_width(bounds_in_parent.width()); | 953 snapped_bounds.set_width(bounds_in_parent.width()); |
954 return bounds_in_parent == snapped_bounds; | 954 return bounds_in_parent == snapped_bounds; |
955 } | 955 } |
956 | 956 |
957 } // namespace ash | 957 } // namespace ash |
OLD | NEW |