Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / ozone / platform / ozone_platform_wayland.cc
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.
4
5 #include "ozone/platform/ozone_platform_wayland.h"
6
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"
10 #endif
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"
16
17 namespace ui {
18
19 namespace {
20
21 // OzonePlatform for Wayland
22 //
23 // This platform is Linux with the Wayland display server.
24 class OzonePlatformWayland : public OzonePlatform {
25  public:
26   OzonePlatformWayland() {}
27
28   virtual ~OzonePlatformWayland() {}
29
30   // OzonePlatform:
31   virtual gfx::SurfaceFactoryOzone* GetSurfaceFactoryOzone() OVERRIDE {
32     return &wayland_display_;
33   }
34   virtual ui::EventFactoryOzone* GetEventFactoryOzone() OVERRIDE {
35     return &event_factory_ozone_;
36   }
37   virtual ui::InputMethodContextFactoryOzone*
38   GetInputMethodContextFactoryOzone() OVERRIDE {
39     return &input_method_context_factory_;
40   }
41   virtual ui::CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE {
42     return &cursor_factory_ozone_;
43   }
44
45  private:
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_;
52 #endif
53   DISALLOW_COPY_AND_ASSIGN(OzonePlatformWayland);
54 };
55
56 }  // namespace
57
58 OzonePlatform* CreateOzonePlatformWayland() { return new OzonePlatformWayland; }
59
60 }  // namespace ui