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