Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Side by Side Diff: services/ui/public/cpp/window_tree_client.cc

Issue 2352233002: mus drag and drop: Add API to let the client cancel the drag. (Closed)
Patch Set: A bunch of dvlogs Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « services/ui/public/cpp/window_tree_client.h ('k') | services/ui/public/interfaces/window_tree.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698