| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef UI_OZONE_PLATFORM_WAYLAND_FAKE_SERVER_H_ | 5 #ifndef UI_OZONE_PLATFORM_WAYLAND_FAKE_SERVER_H_ |
| 6 #define UI_OZONE_PLATFORM_WAYLAND_FAKE_SERVER_H_ | 6 #define UI_OZONE_PLATFORM_WAYLAND_FAKE_SERVER_H_ |
| 7 | 7 |
| 8 #include <wayland-server-core.h> | 8 #include <wayland-server-core.h> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 | 77 |
| 78 class MockPointer : public ServerObject { | 78 class MockPointer : public ServerObject { |
| 79 public: | 79 public: |
| 80 MockPointer(wl_resource* resource); | 80 MockPointer(wl_resource* resource); |
| 81 ~MockPointer() override; | 81 ~MockPointer() override; |
| 82 | 82 |
| 83 private: | 83 private: |
| 84 DISALLOW_COPY_AND_ASSIGN(MockPointer); | 84 DISALLOW_COPY_AND_ASSIGN(MockPointer); |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 class MockKeyboard : public ServerObject { |
| 88 public: |
| 89 MockKeyboard(wl_resource* resource); |
| 90 ~MockKeyboard() override; |
| 91 |
| 92 private: |
| 93 DISALLOW_COPY_AND_ASSIGN(MockKeyboard); |
| 94 }; |
| 95 |
| 87 struct GlobalDeleter { | 96 struct GlobalDeleter { |
| 88 void operator()(wl_global* global); | 97 void operator()(wl_global* global); |
| 89 }; | 98 }; |
| 90 | 99 |
| 91 // Base class for managing the life cycle of global objects: | 100 // Base class for managing the life cycle of global objects: |
| 92 // It presents a global object used to emit global events to all clients. | 101 // It presents a global object used to emit global events to all clients. |
| 93 class Global { | 102 class Global { |
| 94 public: | 103 public: |
| 95 Global(const wl_interface* interface, | 104 Global(const wl_interface* interface, |
| 96 const void* implementation, | 105 const void* implementation, |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 DISALLOW_COPY_AND_ASSIGN(MockOutput); | 162 DISALLOW_COPY_AND_ASSIGN(MockOutput); |
| 154 }; | 163 }; |
| 155 | 164 |
| 156 // Manage wl_seat object: group of input devices. | 165 // Manage wl_seat object: group of input devices. |
| 157 class MockSeat : public Global { | 166 class MockSeat : public Global { |
| 158 public: | 167 public: |
| 159 MockSeat(); | 168 MockSeat(); |
| 160 ~MockSeat() override; | 169 ~MockSeat() override; |
| 161 | 170 |
| 162 std::unique_ptr<MockPointer> pointer; | 171 std::unique_ptr<MockPointer> pointer; |
| 172 std::unique_ptr<MockKeyboard> keyboard; |
| 163 | 173 |
| 164 private: | 174 private: |
| 165 DISALLOW_COPY_AND_ASSIGN(MockSeat); | 175 DISALLOW_COPY_AND_ASSIGN(MockSeat); |
| 166 }; | 176 }; |
| 167 | 177 |
| 168 // Manage xdg_shell object. | 178 // Manage xdg_shell object. |
| 169 class MockXdgShell : public Global { | 179 class MockXdgShell : public Global { |
| 170 public: | 180 public: |
| 171 MockXdgShell(); | 181 MockXdgShell(); |
| 172 ~MockXdgShell() override; | 182 ~MockXdgShell() override; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 MockXdgShell xdg_shell_; | 243 MockXdgShell xdg_shell_; |
| 234 | 244 |
| 235 base::MessagePumpLibevent::FileDescriptorWatcher controller_; | 245 base::MessagePumpLibevent::FileDescriptorWatcher controller_; |
| 236 | 246 |
| 237 DISALLOW_COPY_AND_ASSIGN(FakeServer); | 247 DISALLOW_COPY_AND_ASSIGN(FakeServer); |
| 238 }; | 248 }; |
| 239 | 249 |
| 240 } // namespace wl | 250 } // namespace wl |
| 241 | 251 |
| 242 #endif // UI_OZONE_PLATFORM_WAYLAND_FAKE_SERVER_H_ | 252 #endif // UI_OZONE_PLATFORM_WAYLAND_FAKE_SERVER_H_ |
| OLD | NEW |