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

Side by Side Diff: services/ui/ws/window_tree.cc

Issue 2349973010: mus drag and drop: return the completed effect to the caller. (Closed)
Patch Set: Rename some effect_taken to action_taken for consistency. 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
« no previous file with comments | « services/ui/ws/window_tree.h ('k') | services/ui/ws/window_tree_client_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/ws/window_tree.h" 5 #include "services/ui/ws/window_tree.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 1760 matching lines...) Expand 10 before | Expand all | Expand 10 after
1771 const ServerWindow* window) const { 1771 const ServerWindow* window) const {
1772 return IsWindowKnown(window); 1772 return IsWindowKnown(window);
1773 } 1773 }
1774 1774
1775 bool WindowTree::IsWindowRootOfAnotherTreeForAccessPolicy( 1775 bool WindowTree::IsWindowRootOfAnotherTreeForAccessPolicy(
1776 const ServerWindow* window) const { 1776 const ServerWindow* window) const {
1777 WindowTree* tree = window_server_->GetTreeWithRoot(window); 1777 WindowTree* tree = window_server_->GetTreeWithRoot(window);
1778 return tree && tree != this; 1778 return tree && tree != this;
1779 } 1779 }
1780 1780
1781 void WindowTree::OnDragCompleted(bool success) { 1781 void WindowTree::OnDragCompleted(bool success, uint32_t action_taken) {
1782 DCHECK(window_server_->in_drag_loop()); 1782 DCHECK(window_server_->in_drag_loop());
1783 1783
1784 if (window_server_->GetCurrentDragLoopInitiator() != this) 1784 if (window_server_->GetCurrentDragLoopInitiator() != this)
1785 return; 1785 return;
1786 1786
1787 uint32_t change_id = window_server_->GetCurrentDragLoopChangeId(); 1787 uint32_t change_id = window_server_->GetCurrentDragLoopChangeId();
1788 ServerWindow* window = window_server_->GetCurrentDragLoopWindow(); 1788 ServerWindow* window = window_server_->GetCurrentDragLoopWindow();
1789 WindowManagerDisplayRoot* display_root = GetWindowManagerDisplayRoot(window); 1789 WindowManagerDisplayRoot* display_root = GetWindowManagerDisplayRoot(window);
1790 if (!display_root) 1790 if (!display_root)
1791 return; 1791 return;
1792 1792
1793 window_server_->EndDragLoop(); 1793 window_server_->EndDragLoop();
1794 WindowManagerState* wms = display_root->window_manager_state(); 1794 WindowManagerState* wms = display_root->window_manager_state();
1795 wms->EndDragDrop(); 1795 wms->EndDragDrop();
1796 1796
1797 client()->OnChangeCompleted(change_id, success); 1797 client()->OnPerformDragDropCompleted(change_id, success, action_taken);
1798 } 1798 }
1799 1799
1800 ServerWindow* WindowTree::GetWindowById(const WindowId& id) { 1800 ServerWindow* WindowTree::GetWindowById(const WindowId& id) {
1801 return GetWindow(id); 1801 return GetWindow(id);
1802 } 1802 }
1803 1803
1804 DragTargetConnection* WindowTree::GetDragTargetForWindow( 1804 DragTargetConnection* WindowTree::GetDragTargetForWindow(
1805 const ServerWindow* window) { 1805 const ServerWindow* window) {
1806 if (!window) 1806 if (!window)
1807 return nullptr; 1807 return nullptr;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1872 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, 1872 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset,
1873 effect_bitmask, callback); 1873 effect_bitmask, callback);
1874 } 1874 }
1875 1875
1876 void WindowTree::PerformOnDragDropDone() { 1876 void WindowTree::PerformOnDragDropDone() {
1877 client()->OnDragDropDone(); 1877 client()->OnDragDropDone();
1878 } 1878 }
1879 1879
1880 } // namespace ws 1880 } // namespace ws
1881 } // namespace ui 1881 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/window_tree.h ('k') | services/ui/ws/window_tree_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698