Chromium Code Reviews| Index: components/exo/wayland/server.cc |
| diff --git a/components/exo/wayland/server.cc b/components/exo/wayland/server.cc |
| index f3fc2aff506e731fc7b296ae5bcf848fd4040196..fbca1f4cd96f5b87a46eed99759f118e966bf3c9 100644 |
| --- a/components/exo/wayland/server.cc |
| +++ b/components/exo/wayland/server.cc |
| @@ -3058,7 +3058,16 @@ void keyboard_configuration_get_keyboard_device_configuration( |
| wl_resource* resource, |
| uint32_t id, |
| wl_resource* keyboard_resource) { |
| - // TODO(yhanada): Produce an error if a delegate already exists. |
| + if (GetUserDataAs<Keyboard>(keyboard_resource) |
|
reveman
2016/12/12 11:52:56
nit: "Keyboard* keyboard = GetUserDataAs<Keyboard>
yhanada
2016/12/12 15:44:03
Done.
|
| + ->HasDeviceConfigurationDelegate()) { |
| + wl_resource_post_error( |
| + resource, |
| + ZCR_KEYBOARD_CONFIGURATION_V1_ERROR_DEVICE_CONFIGURATION_EXISTS, |
| + "keyboard has already been associated with a device configuration " |
| + "object"); |
| + return; |
| + } |
| + |
| wl_resource* keyboard_device_configuration_resource = wl_resource_create( |
| client, &zcr_keyboard_device_configuration_v1_interface, 1, id); |
| @@ -3127,7 +3136,7 @@ Server::Server(Display* display) |
| wl_global_create(wl_display_.get(), &zcr_stylus_v1_interface, 1, display_, |
| bind_stylus); |
| wl_global_create(wl_display_.get(), &zcr_keyboard_configuration_v1_interface, |
| - 1, display_, bind_keyboard_configuration); |
| + 2, display_, bind_keyboard_configuration); |
| } |
| Server::~Server() {} |