| 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 "services/ui/public/cpp/window_tree_client.h" | 5 #include "services/ui/public/cpp/window_tree_client.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 base::MakeUnique<InFlightDragChange>(window, ChangeType::DRAG_LOOP)); | 667 base::MakeUnique<InFlightDragChange>(window, ChangeType::DRAG_LOOP)); |
| 668 current_drag_state_.reset(new CurrentDragState{ | 668 current_drag_state_.reset(new CurrentDragState{ |
| 669 current_drag_change, ui::mojom::kDropEffectNone, callback}); | 669 current_drag_change, ui::mojom::kDropEffectNone, callback}); |
| 670 | 670 |
| 671 tree_->PerformDragDrop( | 671 tree_->PerformDragDrop( |
| 672 current_drag_change, window->server_id(), drag_pointer, | 672 current_drag_change, window->server_id(), drag_pointer, |
| 673 mojo::Map<mojo::String, mojo::Array<uint8_t>>::From(drag_data), | 673 mojo::Map<mojo::String, mojo::Array<uint8_t>>::From(drag_data), |
| 674 drag_operation); | 674 drag_operation); |
| 675 } | 675 } |
| 676 | 676 |
| 677 void WindowTreeClient::CancelDragDrop(Window* window) { |
| 678 // Server will clean up drag and fail the in-flight change. |
| 679 tree_->CancelDragDrop(window->server_id()); |
| 680 } |
| 681 |
| 677 void WindowTreeClient::PerformWindowMove( | 682 void WindowTreeClient::PerformWindowMove( |
| 678 Window* window, | 683 Window* window, |
| 679 ui::mojom::MoveLoopSource source, | 684 ui::mojom::MoveLoopSource source, |
| 680 const gfx::Point& cursor_location, | 685 const gfx::Point& cursor_location, |
| 681 const base::Callback<void(bool)>& callback) { | 686 const base::Callback<void(bool)>& callback) { |
| 682 DCHECK(on_current_move_finished_.is_null()); | 687 DCHECK(on_current_move_finished_.is_null()); |
| 683 on_current_move_finished_ = callback; | 688 on_current_move_finished_ = callback; |
| 684 | 689 |
| 685 current_move_loop_change_ = ScheduleInFlightChange( | 690 current_move_loop_change_ = ScheduleInFlightChange( |
| 686 base::MakeUnique<InFlightDragChange>(window, ChangeType::MOVE_LOOP)); | 691 base::MakeUnique<InFlightDragChange>(window, ChangeType::MOVE_LOOP)); |
| (...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1406 Window* window, | 1411 Window* window, |
| 1407 const gfx::Vector2d& offset, | 1412 const gfx::Vector2d& offset, |
| 1408 const gfx::Insets& hit_area) { | 1413 const gfx::Insets& hit_area) { |
| 1409 if (window_manager_internal_client_) { | 1414 if (window_manager_internal_client_) { |
| 1410 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( | 1415 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( |
| 1411 server_id(window), offset.x(), offset.y(), hit_area); | 1416 server_id(window), offset.x(), offset.y(), hit_area); |
| 1412 } | 1417 } |
| 1413 } | 1418 } |
| 1414 | 1419 |
| 1415 } // namespace ui | 1420 } // namespace ui |
| OLD | NEW |