Chromium Code Reviews| Index: components/exo/wayland/server.cc |
| diff --git a/components/exo/wayland/server.cc b/components/exo/wayland/server.cc |
| index 55e347a39b440639c4d2b78aa6cd1d2337b8f8e0..844253559c8d4d079f6d583db05d82ee755eb755 100644 |
| --- a/components/exo/wayland/server.cc |
| +++ b/components/exo/wayland/server.cc |
| @@ -41,6 +41,7 @@ |
| #include "components/exo/display.h" |
| #include "components/exo/keyboard.h" |
| #include "components/exo/keyboard_delegate.h" |
| +#include "components/exo/notification_surface.h" |
| #include "components/exo/pointer.h" |
| #include "components/exo/pointer_delegate.h" |
| #include "components/exo/shared_memory.h" |
| @@ -1491,6 +1492,16 @@ const struct zwp_remote_surface_v1_interface remote_surface_implementation = { |
| remote_surface_unfullscreen}; |
| //////////////////////////////////////////////////////////////////////////////// |
| +// notification_surface_interface: |
| + |
| +void notification_surface_destroy(wl_client* client, wl_resource* resource) { |
| + wl_resource_destroy(resource); |
| +} |
| + |
| +const struct zwp_notification_surface_v1_interface |
| + notification_surface_implementation = {notification_surface_destroy}; |
| + |
| +//////////////////////////////////////////////////////////////////////////////// |
| // remote_shell_interface: |
| // Implements remote shell interface and monitors workspace state needed |
| @@ -1523,6 +1534,12 @@ class WaylandRemoteShell : public ash::ShellObserver, |
| return display_->CreateRemoteShellSurface(surface, container); |
| } |
| + std::unique_ptr<NotificationSurface> CreateNotificationSurface( |
| + Surface* surface, |
| + const std::string& notification_id) { |
| + return display_->CreateNotificationSurface(surface, notification_id); |
| + } |
| + |
| // Overridden from display::DisplayObserver: |
| void OnDisplayAdded(const display::Display& new_display) override {} |
| void OnDisplayRemoved(const display::Display& new_display) override {} |
| @@ -1690,10 +1707,29 @@ void remote_shell_get_remote_surface(wl_client* client, |
| std::move(shell_surface)); |
| } |
| +void remote_shell_get_notification_surface(wl_client* client, |
| + wl_resource* resource, |
| + uint32_t id, |
| + wl_resource* surface, |
| + const char* notification_id) { |
| + std::unique_ptr<NotificationSurface> notification_surface = |
| + GetUserDataAs<WaylandRemoteShell>(resource)->CreateNotificationSurface( |
| + GetUserDataAs<Surface>(surface), std::string(notification_id)); |
| + DCHECK(notification_surface); |
|
reveman
2016/06/16 03:35:20
what can cause this to fail? fyi, if the client ca
xiyuan
2016/06/20 22:40:29
Replaced with notification id validating and role
|
| + |
| + wl_resource* notification_surface_resource = |
| + wl_resource_create(client, &zwp_notification_surface_v1_interface, |
| + wl_resource_get_version(resource), id); |
| + SetImplementation(notification_surface_resource, |
| + ¬ification_surface_implementation, |
| + std::move(notification_surface)); |
| +} |
| + |
| const struct zwp_remote_shell_v1_interface remote_shell_implementation = { |
| - remote_shell_destroy, remote_shell_get_remote_surface}; |
| + remote_shell_destroy, remote_shell_get_remote_surface, |
| + remote_shell_get_notification_surface}; |
| -const uint32_t remote_shell_version = 3; |
| +const uint32_t remote_shell_version = 4; |
| void bind_remote_shell(wl_client* client, |
| void* data, |