| 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 1920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1931 return; | 1931 return; |
| 1932 } | 1932 } |
| 1933 // Use the first display. | 1933 // Use the first display. |
| 1934 std::set<Display*> displays = window_server_->display_manager()->displays(); | 1934 std::set<Display*> displays = window_server_->display_manager()->displays(); |
| 1935 if (displays.empty()) | 1935 if (displays.empty()) |
| 1936 return; | 1936 return; |
| 1937 | 1937 |
| 1938 (*displays.begin())->ActivateNextWindow(); | 1938 (*displays.begin())->ActivateNextWindow(); |
| 1939 } | 1939 } |
| 1940 | 1940 |
| 1941 void WindowTree::SetUnderlaySurfaceOffsetAndExtendedHitArea( | 1941 void WindowTree::SetExtendedHitArea(Id window_id, const gfx::Insets& hit_area) { |
| 1942 Id window_id, | |
| 1943 int32_t x_offset, | |
| 1944 int32_t y_offset, | |
| 1945 const gfx::Insets& hit_area) { | |
| 1946 ServerWindow* window = GetWindowByClientId(ClientWindowId(window_id)); | 1942 ServerWindow* window = GetWindowByClientId(ClientWindowId(window_id)); |
| 1947 if (!window) | 1943 // Extended hit test region should only be set by the owner of the window. |
| 1944 if (!window) { |
| 1945 DVLOG(1) << "SetExtendedHitArea supplied unknown window"; |
| 1948 return; | 1946 return; |
| 1949 | 1947 } |
| 1950 window->SetUnderlayOffset(gfx::Vector2d(x_offset, y_offset)); | 1948 if (window->id().client_id != id_) { |
| 1949 DVLOG(1) << "SetExtendedHitArea supplied window that client does not own"; |
| 1950 return; |
| 1951 } |
| 1951 window->set_extended_hit_test_region(hit_area); | 1952 window->set_extended_hit_test_region(hit_area); |
| 1952 } | 1953 } |
| 1953 | 1954 |
| 1954 void WindowTree::WmResponse(uint32_t change_id, bool response) { | 1955 void WindowTree::WmResponse(uint32_t change_id, bool response) { |
| 1955 if (window_server_->in_move_loop() && | 1956 if (window_server_->in_move_loop() && |
| 1956 window_server_->GetCurrentMoveLoopChangeId() == change_id) { | 1957 window_server_->GetCurrentMoveLoopChangeId() == change_id) { |
| 1957 ServerWindow* window = window_server_->GetCurrentMoveLoopWindow(); | 1958 ServerWindow* window = window_server_->GetCurrentMoveLoopWindow(); |
| 1958 | 1959 |
| 1959 if (window->id().client_id != id_) { | 1960 if (window->id().client_id != id_) { |
| 1960 window_server_->WindowManagerSentBogusMessage(); | 1961 window_server_->WindowManagerSentBogusMessage(); |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2154 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, | 2155 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, |
| 2155 effect_bitmask, callback); | 2156 effect_bitmask, callback); |
| 2156 } | 2157 } |
| 2157 | 2158 |
| 2158 void WindowTree::PerformOnDragDropDone() { | 2159 void WindowTree::PerformOnDragDropDone() { |
| 2159 client()->OnDragDropDone(); | 2160 client()->OnDragDropDone(); |
| 2160 } | 2161 } |
| 2161 | 2162 |
| 2162 } // namespace ws | 2163 } // namespace ws |
| 2163 } // namespace ui | 2164 } // namespace ui |
| OLD | NEW |