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 "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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/auto_reset.h" | 13 #include "base/auto_reset.h" |
| 14 #include "base/bind.h" | 14 #include "base/bind.h" |
| 15 #include "base/memory/ptr_util.h" | 15 #include "base/memory/ptr_util.h" |
| 16 #include "services/service_manager/public/cpp/connector.h" | 16 #include "services/service_manager/public/cpp/connector.h" |
| 17 #include "services/ui/common/accelerator_util.h" | |
| 17 #include "services/ui/public/cpp/property_type_converters.h" | 18 #include "services/ui/public/cpp/property_type_converters.h" |
| 18 #include "services/ui/public/interfaces/constants.mojom.h" | 19 #include "services/ui/public/interfaces/constants.mojom.h" |
| 19 #include "services/ui/public/interfaces/window_manager.mojom.h" | 20 #include "services/ui/public/interfaces/window_manager.mojom.h" |
| 20 #include "services/ui/public/interfaces/window_manager_window_tree_factory.mojom .h" | 21 #include "services/ui/public/interfaces/window_manager_window_tree_factory.mojom .h" |
| 21 #include "ui/aura/client/aura_constants.h" | 22 #include "ui/aura/client/aura_constants.h" |
| 22 #include "ui/aura/client/drag_drop_client.h" | 23 #include "ui/aura/client/drag_drop_client.h" |
| 23 #include "ui/aura/client/transient_window_client.h" | 24 #include "ui/aura/client/transient_window_client.h" |
| 24 #include "ui/aura/mus/capture_synchronizer.h" | 25 #include "ui/aura/mus/capture_synchronizer.h" |
| 25 #include "ui/aura/mus/drag_drop_controller_mus.h" | 26 #include "ui/aura/mus/drag_drop_controller_mus.h" |
| 26 #include "ui/aura/mus/focus_synchronizer.h" | 27 #include "ui/aura/mus/focus_synchronizer.h" |
| (...skipping 1397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1424 ui::mojom::Cursor cursor_id) { | 1425 ui::mojom::Cursor cursor_id) { |
| 1425 window_manager_internal_client_->WmSetNonClientCursor( | 1426 window_manager_internal_client_->WmSetNonClientCursor( |
| 1426 WindowMus::Get(window)->server_id(), cursor_id); | 1427 WindowMus::Get(window)->server_id(), cursor_id); |
| 1427 } | 1428 } |
| 1428 | 1429 |
| 1429 void WindowTreeClient::AddAccelerator( | 1430 void WindowTreeClient::AddAccelerator( |
| 1430 uint32_t id, | 1431 uint32_t id, |
| 1431 ui::mojom::EventMatcherPtr event_matcher, | 1432 ui::mojom::EventMatcherPtr event_matcher, |
| 1432 const base::Callback<void(bool)>& callback) { | 1433 const base::Callback<void(bool)>& callback) { |
| 1433 if (window_manager_internal_client_) { | 1434 if (window_manager_internal_client_) { |
| 1434 window_manager_internal_client_->AddAccelerator( | 1435 std::vector<ui::mojom::AcceleratorPtr> accelerators = |
|
mfomitchev
2016/12/01 15:32:37
nit: no need to create a local var
thanhph
2016/12/01 19:03:20
Done.
| |
| 1435 id, std::move(event_matcher), callback); | 1436 ui::CreateAcceleratorVector(id, std::move(event_matcher)); |
| 1437 window_manager_internal_client_->AddAccelerators(std::move(accelerators), | |
| 1438 callback); | |
| 1439 ; | |
| 1436 } | 1440 } |
| 1437 } | 1441 } |
| 1438 | 1442 |
| 1439 void WindowTreeClient::RemoveAccelerator(uint32_t id) { | 1443 void WindowTreeClient::RemoveAccelerator(uint32_t id) { |
| 1440 if (window_manager_internal_client_) { | 1444 if (window_manager_internal_client_) { |
| 1441 window_manager_internal_client_->RemoveAccelerator(id); | 1445 window_manager_internal_client_->RemoveAccelerator(id); |
| 1442 } | 1446 } |
| 1443 } | 1447 } |
| 1444 | 1448 |
| 1445 void WindowTreeClient::AddActivationParent(Window* window) { | 1449 void WindowTreeClient::AddActivationParent(Window* window) { |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1587 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( | 1591 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( |
| 1588 this, capture_synchronizer_.get(), window)); | 1592 this, capture_synchronizer_.get(), window)); |
| 1589 } | 1593 } |
| 1590 | 1594 |
| 1591 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { | 1595 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { |
| 1592 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( | 1596 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( |
| 1593 this, focus_synchronizer_.get(), window)); | 1597 this, focus_synchronizer_.get(), window)); |
| 1594 } | 1598 } |
| 1595 | 1599 |
| 1596 } // namespace aura | 1600 } // namespace aura |
| OLD | NEW |