| 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 InputMethodContextFactoryOzone; | |
| 20 class NativeDisplayDelegate; | 19 class NativeDisplayDelegate; |
| 21 | 20 |
| 22 // Base class for Ozone platform implementations. | 21 // Base class for Ozone platform implementations. |
| 23 // | 22 // |
| 24 // Ozone platforms must override this class and implement the virtual | 23 // Ozone platforms must override this class and implement the virtual |
| 25 // GetFooFactoryOzone() methods to provide implementations of the | 24 // GetFooFactoryOzone() methods to provide implementations of the |
| 26 // various ozone interfaces. | 25 // various ozone interfaces. |
| 27 // | 26 // |
| 28 // The OzonePlatform subclass can own any state needed by the | 27 // The OzonePlatform subclass can own any state needed by the |
| 29 // implementation that is shared between the various ozone interfaces, | 28 // implementation that is shared between the various ozone interfaces, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 45 // Initializes the subsystems/resources necessary for the GPU process. | 44 // Initializes the subsystems/resources necessary for the GPU process. |
| 46 static void InitializeForGPU(); | 45 static void InitializeForGPU(); |
| 47 | 46 |
| 48 static OzonePlatform* GetInstance(); | 47 static OzonePlatform* GetInstance(); |
| 49 | 48 |
| 50 // Factory getters to override in subclasses. The returned objects will be | 49 // Factory getters to override in subclasses. The returned objects will be |
| 51 // injected into the appropriate layer at startup. Subclasses should not | 50 // injected into the appropriate layer at startup. Subclasses should not |
| 52 // inject these objects themselves. Ownership is retained by OzonePlatform. | 51 // inject these objects themselves. Ownership is retained by OzonePlatform. |
| 53 virtual gfx::SurfaceFactoryOzone* GetSurfaceFactoryOzone() = 0; | 52 virtual gfx::SurfaceFactoryOzone* GetSurfaceFactoryOzone() = 0; |
| 54 virtual ui::EventFactoryOzone* GetEventFactoryOzone() = 0; | 53 virtual ui::EventFactoryOzone* GetEventFactoryOzone() = 0; |
| 55 virtual ui::InputMethodContextFactoryOzone* | |
| 56 GetInputMethodContextFactoryOzone() = 0; | |
| 57 virtual ui::CursorFactoryOzone* GetCursorFactoryOzone() = 0; | 54 virtual ui::CursorFactoryOzone* GetCursorFactoryOzone() = 0; |
| 58 #if defined(OS_CHROMEOS) | 55 #if defined(OS_CHROMEOS) |
| 59 virtual scoped_ptr<ui::NativeDisplayDelegate> | 56 virtual scoped_ptr<ui::NativeDisplayDelegate> |
| 60 CreateNativeDisplayDelegate() = 0; | 57 CreateNativeDisplayDelegate() = 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 |