OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/exo/shell_surface.h" | 5 #include "components/exo/shell_surface.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/frame/custom_frame_view_ash.h" | 9 #include "ash/frame/custom_frame_view_ash.h" |
10 #include "ash/public/cpp/shell_window_ids.h" | 10 #include "ash/public/cpp/shell_window_ids.h" |
11 #include "ash/public/cpp/window_properties.h" | 11 #include "ash/public/cpp/window_properties.h" |
12 #include "ash/public/interfaces/window_pin_type.mojom.h" | 12 #include "ash/public/interfaces/window_pin_type.mojom.h" |
13 #include "ash/shelf/wm_shelf.h" | 13 #include "ash/shelf/wm_shelf.h" |
14 #include "ash/shell_port.h" | 14 #include "ash/shell_port.h" |
15 #include "ash/wm/drag_window_resizer.h" | 15 #include "ash/wm/drag_window_resizer.h" |
16 #include "ash/wm/window_resizer.h" | 16 #include "ash/wm/window_resizer.h" |
17 #include "ash/wm/window_state.h" | 17 #include "ash/wm/window_state.h" |
18 #include "ash/wm/window_util.h" | 18 #include "ash/wm/window_util.h" |
19 #include "ash/wm_window.h" | |
20 #include "base/logging.h" | 19 #include "base/logging.h" |
21 #include "base/macros.h" | 20 #include "base/macros.h" |
22 #include "base/memory/ptr_util.h" | 21 #include "base/memory/ptr_util.h" |
23 #include "base/strings/utf_string_conversions.h" | 22 #include "base/strings/utf_string_conversions.h" |
24 #include "base/trace_event/trace_event.h" | 23 #include "base/trace_event/trace_event.h" |
25 #include "base/trace_event/trace_event_argument.h" | 24 #include "base/trace_event/trace_event_argument.h" |
26 #include "components/exo/surface.h" | 25 #include "components/exo/surface.h" |
27 #include "ui/aura/client/aura_constants.h" | 26 #include "ui/aura/client/aura_constants.h" |
28 #include "ui/aura/client/cursor_client.h" | 27 #include "ui/aura/client/cursor_client.h" |
29 #include "ui/aura/window.h" | 28 #include "ui/aura/window.h" |
(...skipping 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1306 cursor_client->SetCursor(ui::CursorType::kWestResize); | 1305 cursor_client->SetCursor(ui::CursorType::kWestResize); |
1307 break; | 1306 break; |
1308 case HTTOPLEFT: | 1307 case HTTOPLEFT: |
1309 cursor_client->SetCursor(ui::CursorType::kNorthWestResize); | 1308 cursor_client->SetCursor(ui::CursorType::kNorthWestResize); |
1310 break; | 1309 break; |
1311 default: | 1310 default: |
1312 NOTREACHED(); | 1311 NOTREACHED(); |
1313 break; | 1312 break; |
1314 } | 1313 } |
1315 | 1314 |
1316 resizer_ = ash::CreateWindowResizer(ash::WmWindow::Get(window), | 1315 resizer_ = ash::CreateWindowResizer(window, GetMouseLocation(), component, |
1317 GetMouseLocation(), component, | |
1318 aura::client::WINDOW_MOVE_SOURCE_MOUSE); | 1316 aura::client::WINDOW_MOVE_SOURCE_MOUSE); |
1319 if (!resizer_) | 1317 if (!resizer_) |
1320 return; | 1318 return; |
1321 | 1319 |
1322 // Apply pending origin offsets and resize direction before starting a | 1320 // Apply pending origin offsets and resize direction before starting a |
1323 // new resize operation. These can still be pending if the client has | 1321 // new resize operation. These can still be pending if the client has |
1324 // acknowledged the configure request but not yet called Commit(). | 1322 // acknowledged the configure request but not yet called Commit(). |
1325 origin_offset_ += pending_origin_offset_; | 1323 origin_offset_ += pending_origin_offset_; |
1326 pending_origin_offset_ = gfx::Vector2d(); | 1324 pending_origin_offset_ = gfx::Vector2d(); |
1327 resize_component_ = pending_resize_component_; | 1325 resize_component_ = pending_resize_component_; |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1666 gfx::Point ShellSurface::GetMouseLocation() const { | 1664 gfx::Point ShellSurface::GetMouseLocation() const { |
1667 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow(); | 1665 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow(); |
1668 gfx::Point location = | 1666 gfx::Point location = |
1669 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); | 1667 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); |
1670 aura::Window::ConvertPointToTarget( | 1668 aura::Window::ConvertPointToTarget( |
1671 root_window, widget_->GetNativeWindow()->parent(), &location); | 1669 root_window, widget_->GetNativeWindow()->parent(), &location); |
1672 return location; | 1670 return location; |
1673 } | 1671 } |
1674 | 1672 |
1675 } // namespace exo | 1673 } // namespace exo |
OLD | NEW |