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 "ui/aura/mus/window_tree_client.h" | 5 #include "ui/aura/mus/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 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 | 819 |
820 void WindowTreeClient::AddTestObserver(WindowTreeClientTestObserver* observer) { | 820 void WindowTreeClient::AddTestObserver(WindowTreeClientTestObserver* observer) { |
821 test_observers_.AddObserver(observer); | 821 test_observers_.AddObserver(observer); |
822 } | 822 } |
823 | 823 |
824 void WindowTreeClient::RemoveTestObserver( | 824 void WindowTreeClient::RemoveTestObserver( |
825 WindowTreeClientTestObserver* observer) { | 825 WindowTreeClientTestObserver* observer) { |
826 test_observers_.RemoveObserver(observer); | 826 test_observers_.RemoveObserver(observer); |
827 } | 827 } |
828 | 828 |
829 void WindowTreeClient::SetCanAcceptDrops(Id window_id, bool can_accept_drops) { | 829 void WindowTreeClient::SetCanAcceptDrops(WindowMus* window, |
| 830 bool can_accept_drops) { |
830 DCHECK(tree_); | 831 DCHECK(tree_); |
831 tree_->SetCanAcceptDrops(window_id, can_accept_drops); | 832 tree_->SetCanAcceptDrops(window->server_id(), can_accept_drops); |
832 } | 833 } |
833 | 834 |
834 void WindowTreeClient::SetEventTargetingPolicy( | 835 void WindowTreeClient::SetEventTargetingPolicy( |
835 WindowMus* window, | 836 WindowMus* window, |
836 ui::mojom::EventTargetingPolicy policy) { | 837 ui::mojom::EventTargetingPolicy policy) { |
837 DCHECK(tree_); | 838 DCHECK(tree_); |
838 tree_->SetEventTargetingPolicy(window->server_id(), policy); | 839 tree_->SetEventTargetingPolicy(window->server_id(), policy); |
839 } | 840 } |
840 | 841 |
841 void WindowTreeClient::OnEmbed(ClientSpecificId client_id, | 842 void WindowTreeClient::OnEmbed(ClientSpecificId client_id, |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1261 const gfx::Point& position, | 1262 const gfx::Point& position, |
1262 uint32_t effect_bitmask, | 1263 uint32_t effect_bitmask, |
1263 const OnCompleteDropCallback& callback) { | 1264 const OnCompleteDropCallback& callback) { |
1264 callback.Run(drag_drop_controller_->OnCompleteDrop( | 1265 callback.Run(drag_drop_controller_->OnCompleteDrop( |
1265 GetWindowByServerId(window_id), key_state, position, effect_bitmask)); | 1266 GetWindowByServerId(window_id), key_state, position, effect_bitmask)); |
1266 } | 1267 } |
1267 | 1268 |
1268 void WindowTreeClient::OnPerformDragDropCompleted(uint32_t change_id, | 1269 void WindowTreeClient::OnPerformDragDropCompleted(uint32_t change_id, |
1269 bool success, | 1270 bool success, |
1270 uint32_t action_taken) { | 1271 uint32_t action_taken) { |
1271 if (drag_drop_controller_->DoesChangeIdMatchDragChangeId(change_id)) { | 1272 OnChangeCompleted(change_id, success); |
1272 OnChangeCompleted(change_id, success); | 1273 if (drag_drop_controller_->DoesChangeIdMatchDragChangeId(change_id)) |
1273 drag_drop_controller_->OnPerformDragDropCompleted(action_taken); | 1274 drag_drop_controller_->OnPerformDragDropCompleted(action_taken); |
1274 } | |
1275 } | 1275 } |
1276 | 1276 |
1277 void WindowTreeClient::OnChangeCompleted(uint32_t change_id, bool success) { | 1277 void WindowTreeClient::OnChangeCompleted(uint32_t change_id, bool success) { |
1278 std::unique_ptr<InFlightChange> change(std::move(in_flight_map_[change_id])); | 1278 std::unique_ptr<InFlightChange> change(std::move(in_flight_map_[change_id])); |
1279 in_flight_map_.erase(change_id); | 1279 in_flight_map_.erase(change_id); |
1280 if (!change) | 1280 if (!change) |
1281 return; | 1281 return; |
1282 | 1282 |
1283 for (auto& observer : test_observers_) | 1283 for (auto& observer : test_observers_) |
1284 observer.OnChangeCompleted(change_id, change->change_type(), success); | 1284 observer.OnChangeCompleted(change_id, change->change_type(), success); |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1823 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( | 1823 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( |
1824 this, capture_synchronizer_.get(), window)); | 1824 this, capture_synchronizer_.get(), window)); |
1825 } | 1825 } |
1826 | 1826 |
1827 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { | 1827 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { |
1828 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( | 1828 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( |
1829 this, focus_synchronizer_.get(), window)); | 1829 this, focus_synchronizer_.get(), window)); |
1830 } | 1830 } |
1831 | 1831 |
1832 } // namespace aura | 1832 } // namespace aura |
OLD | NEW |