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