| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "ui/ozone/platform/dri/ozone_platform_dri.h" | 5 #include "ui/ozone/platform/dri/ozone_platform_dri.h" |
| 6 | 6 |
| 7 #include "ui/events/ozone/device/device_manager.h" | 7 #include "ui/events/ozone/device/device_manager.h" |
| 8 #include "ui/events/ozone/evdev/cursor_delegate_evdev.h" | 8 #include "ui/events/ozone/evdev/cursor_delegate_evdev.h" |
| 9 #include "ui/events/ozone/evdev/event_factory_evdev.h" | 9 #include "ui/events/ozone/evdev/event_factory_evdev.h" |
| 10 #include "ui/ozone/ime/input_method_context_factory_ozone.h" | |
| 11 #include "ui/ozone/ozone_platform.h" | 10 #include "ui/ozone/ozone_platform.h" |
| 12 #include "ui/ozone/platform/dri/cursor_factory_evdev_dri.h" | 11 #include "ui/ozone/platform/dri/cursor_factory_evdev_dri.h" |
| 13 #include "ui/ozone/platform/dri/dri_surface_factory.h" | 12 #include "ui/ozone/platform/dri/dri_surface_factory.h" |
| 14 #include "ui/ozone/platform/dri/dri_wrapper.h" | 13 #include "ui/ozone/platform/dri/dri_wrapper.h" |
| 15 #include "ui/ozone/platform/dri/screen_manager.h" | 14 #include "ui/ozone/platform/dri/screen_manager.h" |
| 16 | 15 |
| 17 #if defined(OS_CHROMEOS) | 16 #if defined(OS_CHROMEOS) |
| 18 #include "ui/ozone/platform/dri/chromeos/native_display_delegate_dri.h" | 17 #include "ui/ozone/platform/dri/chromeos/native_display_delegate_dri.h" |
| 19 #endif | 18 #endif |
| 20 | 19 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 36 device_manager_(CreateDeviceManager()) {} | 35 device_manager_(CreateDeviceManager()) {} |
| 37 virtual ~OzonePlatformDri() {} | 36 virtual ~OzonePlatformDri() {} |
| 38 | 37 |
| 39 // OzonePlatform: | 38 // OzonePlatform: |
| 40 virtual gfx::SurfaceFactoryOzone* GetSurfaceFactoryOzone() OVERRIDE { | 39 virtual gfx::SurfaceFactoryOzone* GetSurfaceFactoryOzone() OVERRIDE { |
| 41 return surface_factory_ozone_.get(); | 40 return surface_factory_ozone_.get(); |
| 42 } | 41 } |
| 43 virtual EventFactoryOzone* GetEventFactoryOzone() OVERRIDE { | 42 virtual EventFactoryOzone* GetEventFactoryOzone() OVERRIDE { |
| 44 return event_factory_ozone_.get(); | 43 return event_factory_ozone_.get(); |
| 45 } | 44 } |
| 46 virtual InputMethodContextFactoryOzone* GetInputMethodContextFactoryOzone() | |
| 47 OVERRIDE { | |
| 48 return input_method_context_factory_ozone_.get(); | |
| 49 } | |
| 50 virtual CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE { | 45 virtual CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE { |
| 51 return cursor_factory_ozone_.get(); | 46 return cursor_factory_ozone_.get(); |
| 52 } | 47 } |
| 53 #if defined(OS_CHROMEOS) | 48 #if defined(OS_CHROMEOS) |
| 54 virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() | 49 virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() |
| 55 OVERRIDE { | 50 OVERRIDE { |
| 56 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateDri( | 51 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateDri( |
| 57 dri_.get(), screen_manager_.get(), device_manager_.get())); | 52 dri_.get(), screen_manager_.get(), device_manager_.get())); |
| 58 } | 53 } |
| 59 #endif | 54 #endif |
| 60 virtual void InitializeUI() OVERRIDE { | 55 virtual void InitializeUI() OVERRIDE { |
| 61 surface_factory_ozone_.reset( | 56 surface_factory_ozone_.reset( |
| 62 new DriSurfaceFactory(dri_.get(), screen_manager_.get())); | 57 new DriSurfaceFactory(dri_.get(), screen_manager_.get())); |
| 63 cursor_factory_ozone_.reset( | 58 cursor_factory_ozone_.reset( |
| 64 new CursorFactoryEvdevDri(surface_factory_ozone_.get())); | 59 new CursorFactoryEvdevDri(surface_factory_ozone_.get())); |
| 65 event_factory_ozone_.reset(new EventFactoryEvdev( | 60 event_factory_ozone_.reset(new EventFactoryEvdev( |
| 66 cursor_factory_ozone_.get(), device_manager_.get())); | 61 cursor_factory_ozone_.get(), device_manager_.get())); |
| 67 input_method_context_factory_ozone_.reset( | |
| 68 new InputMethodContextFactoryOzone()); | |
| 69 } | 62 } |
| 70 | 63 |
| 71 virtual void InitializeGPU() OVERRIDE {} | 64 virtual void InitializeGPU() OVERRIDE {} |
| 72 | 65 |
| 73 private: | 66 private: |
| 74 scoped_ptr<DriWrapper> dri_; | 67 scoped_ptr<DriWrapper> dri_; |
| 75 // TODO(dnicoara) Move ownership of |screen_manager_| to NDD. | 68 // TODO(dnicoara) Move ownership of |screen_manager_| to NDD. |
| 76 scoped_ptr<ScreenManager> screen_manager_; | 69 scoped_ptr<ScreenManager> screen_manager_; |
| 77 scoped_ptr<DeviceManager> device_manager_; | 70 scoped_ptr<DeviceManager> device_manager_; |
| 78 | 71 |
| 79 scoped_ptr<DriSurfaceFactory> surface_factory_ozone_; | 72 scoped_ptr<DriSurfaceFactory> surface_factory_ozone_; |
| 80 scoped_ptr<CursorFactoryEvdevDri> cursor_factory_ozone_; | 73 scoped_ptr<CursorFactoryEvdevDri> cursor_factory_ozone_; |
| 81 scoped_ptr<EventFactoryEvdev> event_factory_ozone_; | 74 scoped_ptr<EventFactoryEvdev> event_factory_ozone_; |
| 82 // This creates a minimal input context. | |
| 83 scoped_ptr<InputMethodContextFactoryOzone> | |
| 84 input_method_context_factory_ozone_; | |
| 85 | 75 |
| 86 DISALLOW_COPY_AND_ASSIGN(OzonePlatformDri); | 76 DISALLOW_COPY_AND_ASSIGN(OzonePlatformDri); |
| 87 }; | 77 }; |
| 88 | 78 |
| 89 } // namespace | 79 } // namespace |
| 90 | 80 |
| 91 OzonePlatform* CreateOzonePlatformDri() { return new OzonePlatformDri; } | 81 OzonePlatform* CreateOzonePlatformDri() { return new OzonePlatformDri; } |
| 92 | 82 |
| 93 } // namespace ui | 83 } // namespace ui |
| OLD | NEW |