| 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 #ifndef UI_OZONE_OZONE_PLATFORM_H_ | 5 #ifndef UI_OZONE_OZONE_PLATFORM_H_ |
| 6 #define UI_OZONE_OZONE_PLATFORM_H_ | 6 #define UI_OZONE_OZONE_PLATFORM_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "ui/ozone/ozone_export.h" | 9 #include "ui/ozone/ozone_export.h" |
| 10 | 10 |
| 11 namespace gfx { | 11 namespace gfx { |
| 12 class SurfaceFactoryOzone; | 12 class SurfaceFactoryOzone; |
| 13 } | 13 } |
| 14 | 14 |
| 15 namespace ui { | 15 namespace ui { |
| 16 | 16 |
| 17 class CursorFactoryOzone; | 17 class CursorFactoryOzone; |
| 18 class EventFactoryOzone; | 18 class EventFactoryOzone; |
| 19 class NativeDisplayDelegate; | 19 class NativeDisplayDelegate; |
| 20 class TouchscreenDeviceManager; | 20 class TouchscreenDeviceManager; |
| 21 class GpuPlatformSupport; |
| 22 class GpuPlatformSupportHost; |
| 21 | 23 |
| 22 // Base class for Ozone platform implementations. | 24 // Base class for Ozone platform implementations. |
| 23 // | 25 // |
| 24 // Ozone platforms must override this class and implement the virtual | 26 // Ozone platforms must override this class and implement the virtual |
| 25 // GetFooFactoryOzone() methods to provide implementations of the | 27 // GetFooFactoryOzone() methods to provide implementations of the |
| 26 // various ozone interfaces. | 28 // various ozone interfaces. |
| 27 // | 29 // |
| 28 // The OzonePlatform subclass can own any state needed by the | 30 // The OzonePlatform subclass can own any state needed by the |
| 29 // implementation that is shared between the various ozone interfaces, | 31 // implementation that is shared between the various ozone interfaces, |
| 30 // such as a connection to the windowing system. | 32 // such as a connection to the windowing system. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 46 static void InitializeForGPU(); | 48 static void InitializeForGPU(); |
| 47 | 49 |
| 48 static OzonePlatform* GetInstance(); | 50 static OzonePlatform* GetInstance(); |
| 49 | 51 |
| 50 // Factory getters to override in subclasses. The returned objects will be | 52 // Factory getters to override in subclasses. The returned objects will be |
| 51 // injected into the appropriate layer at startup. Subclasses should not | 53 // injected into the appropriate layer at startup. Subclasses should not |
| 52 // inject these objects themselves. Ownership is retained by OzonePlatform. | 54 // inject these objects themselves. Ownership is retained by OzonePlatform. |
| 53 virtual gfx::SurfaceFactoryOzone* GetSurfaceFactoryOzone() = 0; | 55 virtual gfx::SurfaceFactoryOzone* GetSurfaceFactoryOzone() = 0; |
| 54 virtual ui::EventFactoryOzone* GetEventFactoryOzone() = 0; | 56 virtual ui::EventFactoryOzone* GetEventFactoryOzone() = 0; |
| 55 virtual ui::CursorFactoryOzone* GetCursorFactoryOzone() = 0; | 57 virtual ui::CursorFactoryOzone* GetCursorFactoryOzone() = 0; |
| 58 virtual ui::GpuPlatformSupport* GetGpuPlatformSupport() = 0; |
| 59 virtual ui::GpuPlatformSupportHost* GetGpuPlatformSupportHost() = 0; |
| 56 #if defined(OS_CHROMEOS) | 60 #if defined(OS_CHROMEOS) |
| 57 virtual scoped_ptr<ui::NativeDisplayDelegate> | 61 virtual scoped_ptr<ui::NativeDisplayDelegate> |
| 58 CreateNativeDisplayDelegate() = 0; | 62 CreateNativeDisplayDelegate() = 0; |
| 59 virtual scoped_ptr<ui::TouchscreenDeviceManager> | 63 virtual scoped_ptr<ui::TouchscreenDeviceManager> |
| 60 CreateTouchscreenDeviceManager() = 0; | 64 CreateTouchscreenDeviceManager() = 0; |
| 61 #endif | 65 #endif |
| 62 | 66 |
| 63 private: | 67 private: |
| 64 virtual void InitializeUI() = 0; | 68 virtual void InitializeUI() = 0; |
| 65 virtual void InitializeGPU() = 0; | 69 virtual void InitializeGPU() = 0; |
| 66 | 70 |
| 67 static void CreateInstance(); | 71 static void CreateInstance(); |
| 68 | 72 |
| 69 static OzonePlatform* instance_; | 73 static OzonePlatform* instance_; |
| 70 | 74 |
| 71 DISALLOW_COPY_AND_ASSIGN(OzonePlatform); | 75 DISALLOW_COPY_AND_ASSIGN(OzonePlatform); |
| 72 }; | 76 }; |
| 73 | 77 |
| 74 } // namespace ui | 78 } // namespace ui |
| 75 | 79 |
| 76 #endif // UI_OZONE_OZONE_PLATFORM_H_ | 80 #endif // UI_OZONE_OZONE_PLATFORM_H_ |
| OLD | NEW |