1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ozone/platform/ozone_platform_wayland.h"
7 #include "ozone/ui/cursor/cursor_factory_ozone_wayland.h"
8 #if defined(TOOLKIT_VIEWS) && !defined(OS_CHROMEOS)
9 #include "ozone/ui/desktop_aura/desktop_factory_wayland.h"
11 #include "ozone/ui/events/event_factory_ozone_wayland.h"
12 #include "ozone/ui/ime/input_method_context_factory_wayland.h"
13 #include "ozone/wayland/display.h"
14 #include "ui/base/cursor/ozone/cursor_factory_ozone.h"
15 #include "ui/ozone/ozone_platform.h"
21 // OzonePlatform for Wayland
23 // This platform is Linux with the Wayland display server.
24 class OzonePlatformWayland : public OzonePlatform {
26 OzonePlatformWayland() {}
28 virtual ~OzonePlatformWayland() {}
31 virtual gfx::SurfaceFactoryOzone* GetSurfaceFactoryOzone() OVERRIDE {
32 return &wayland_display_;
34 virtual ui::EventFactoryOzone* GetEventFactoryOzone() OVERRIDE {
35 return &event_factory_ozone_;
37 virtual ui::InputMethodContextFactoryOzone*
38 GetInputMethodContextFactoryOzone() OVERRIDE {
39 return &input_method_context_factory_;
41 virtual ui::CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE {
42 return &cursor_factory_ozone_;
46 ozonewayland::WaylandDisplay wayland_display_;
47 ui::EventFactoryOzoneWayland event_factory_ozone_;
48 ui::InputMethodContextFactoryWayland input_method_context_factory_;
49 ui::CursorFactoryOzoneWayland cursor_factory_ozone_;
50 #if defined(TOOLKIT_VIEWS) && !defined(OS_CHROMEOS)
51 views::DesktopFactoryWayland desktop_factory_ozone_;
53 DISALLOW_COPY_AND_ASSIGN(OzonePlatformWayland);
58 OzonePlatform* CreateOzonePlatformWayland() { return new OzonePlatformWayland; }