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 "components/mus/ws/window_tree.h" | 5 #include "components/mus/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 13 matching lines...) Expand all Loading... |
24 #include "components/mus/ws/server_window_observer.h" | 24 #include "components/mus/ws/server_window_observer.h" |
25 #include "components/mus/ws/user_display_manager.h" | 25 #include "components/mus/ws/user_display_manager.h" |
26 #include "components/mus/ws/window_manager_state.h" | 26 #include "components/mus/ws/window_manager_state.h" |
27 #include "components/mus/ws/window_server.h" | 27 #include "components/mus/ws/window_server.h" |
28 #include "components/mus/ws/window_tree_binding.h" | 28 #include "components/mus/ws/window_tree_binding.h" |
29 #include "ui/display/display.h" | 29 #include "ui/display/display.h" |
30 #include "ui/platform_window/mojo/ime_type_converters.h" | 30 #include "ui/platform_window/mojo/ime_type_converters.h" |
31 #include "ui/platform_window/text_input_state.h" | 31 #include "ui/platform_window/text_input_state.h" |
32 | 32 |
33 using mojo::Array; | 33 using mojo::Array; |
| 34 using mojo::Callback; |
34 using mojo::InterfaceRequest; | 35 using mojo::InterfaceRequest; |
35 using mojo::String; | 36 using mojo::String; |
36 | 37 |
37 namespace mus { | 38 namespace mus { |
38 namespace ws { | 39 namespace ws { |
39 | 40 |
40 class TargetedEvent : public ServerWindowObserver { | 41 class TargetedEvent : public ServerWindowObserver { |
41 public: | 42 public: |
42 TargetedEvent(ServerWindow* target, const ui::Event& event) | 43 TargetedEvent(ServerWindow* target, const ui::Event& event) |
43 : target_(target), event_(ui::Event::Clone(event)) { | 44 : target_(target), event_(ui::Event::Clone(event)) { |
(...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1112 success = true; | 1113 success = true; |
1113 Operation op(this, window_server_, OperationType::REORDER_WINDOW); | 1114 Operation op(this, window_server_, OperationType::REORDER_WINDOW); |
1114 window->Reorder(relative_window, direction); | 1115 window->Reorder(relative_window, direction); |
1115 window_server_->ProcessWindowReorder(window, relative_window, direction); | 1116 window_server_->ProcessWindowReorder(window, relative_window, direction); |
1116 } | 1117 } |
1117 client()->OnChangeCompleted(change_id, success); | 1118 client()->OnChangeCompleted(change_id, success); |
1118 } | 1119 } |
1119 | 1120 |
1120 void WindowTree::GetWindowTree( | 1121 void WindowTree::GetWindowTree( |
1121 Id window_id, | 1122 Id window_id, |
1122 const base::Callback<void(Array<mojom::WindowDataPtr>)>& callback) { | 1123 const Callback<void(Array<mojom::WindowDataPtr>)>& callback) { |
1123 std::vector<const ServerWindow*> windows( | 1124 std::vector<const ServerWindow*> windows( |
1124 GetWindowTree(ClientWindowId(window_id))); | 1125 GetWindowTree(ClientWindowId(window_id))); |
1125 callback.Run(WindowsToWindowDatas(windows)); | 1126 callback.Run(WindowsToWindowDatas(windows)); |
1126 } | 1127 } |
1127 | 1128 |
1128 void WindowTree::SetCapture(uint32_t change_id, Id window_id) { | 1129 void WindowTree::SetCapture(uint32_t change_id, Id window_id) { |
1129 client()->OnChangeCompleted(change_id, SetCapture(ClientWindowId(window_id))); | 1130 client()->OnChangeCompleted(change_id, SetCapture(ClientWindowId(window_id))); |
1130 } | 1131 } |
1131 | 1132 |
1132 void WindowTree::ReleaseCapture(uint32_t change_id, Id window_id) { | 1133 void WindowTree::ReleaseCapture(uint32_t change_id, Id window_id) { |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1507 } | 1508 } |
1508 | 1509 |
1509 bool WindowTree::IsWindowRootOfAnotherTreeForAccessPolicy( | 1510 bool WindowTree::IsWindowRootOfAnotherTreeForAccessPolicy( |
1510 const ServerWindow* window) const { | 1511 const ServerWindow* window) const { |
1511 WindowTree* tree = window_server_->GetTreeWithRoot(window); | 1512 WindowTree* tree = window_server_->GetTreeWithRoot(window); |
1512 return tree && tree != this; | 1513 return tree && tree != this; |
1513 } | 1514 } |
1514 | 1515 |
1515 } // namespace ws | 1516 } // namespace ws |
1516 } // namespace mus | 1517 } // namespace mus |
OLD | NEW |