Chromium Code Reviews| 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/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 Loading... | |
| 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()->OnDragCompletedReturnValue(change_id, action_taken); | |
|
sky
2016/09/20 21:42:03
Can we only call OnDragCompletedReturnValue? By th
Elliot Glaysher
2016/09/20 22:05:25
Removed OnChangeCompleted and made OnDragCompleted
| |
| 1797 client()->OnChangeCompleted(change_id, success); | 1798 client()->OnChangeCompleted(change_id, success); |
| 1798 } | 1799 } |
| 1799 | 1800 |
| 1800 ServerWindow* WindowTree::GetWindowById(const WindowId& id) { | 1801 ServerWindow* WindowTree::GetWindowById(const WindowId& id) { |
| 1801 return GetWindow(id); | 1802 return GetWindow(id); |
| 1802 } | 1803 } |
| 1803 | 1804 |
| 1804 DragTargetConnection* WindowTree::GetDragTargetForWindow( | 1805 DragTargetConnection* WindowTree::GetDragTargetForWindow( |
| 1805 const ServerWindow* window) { | 1806 const ServerWindow* window) { |
| 1806 if (!window) | 1807 if (!window) |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1872 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, | 1873 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, |
| 1873 effect_bitmask, callback); | 1874 effect_bitmask, callback); |
| 1874 } | 1875 } |
| 1875 | 1876 |
| 1876 void WindowTree::PerformOnDragDropDone() { | 1877 void WindowTree::PerformOnDragDropDone() { |
| 1877 client()->OnDragDropDone(); | 1878 client()->OnDragDropDone(); |
| 1878 } | 1879 } |
| 1879 | 1880 |
| 1880 } // namespace ws | 1881 } // namespace ws |
| 1881 } // namespace ui | 1882 } // namespace ui |
| OLD | NEW |